File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 1
1
import docker
2
-
2
+ import os
3
3
4
4
class FailureInjector (object ):
5
5
6
6
def __init__ (self , node = None ):
7
- self .docker_api = docker .from_env ()
7
+ timeout = os .environ .get ('DOCKER_CLIENT_TIMEOUT' )
8
+ if timeout is not None :
9
+ timeout = int (timeout )
10
+ self .docker_api = docker .from_env (timeout = timeout )
8
11
9
12
def container_exec (self , node , command ):
10
13
docker_node = self .docker_api .containers .get (node )
Original file line number Diff line number Diff line change 28
28
# https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#accessing-the-services
29
29
NODE_HOST = 'docker' if 'DOCKER_HOST' in os .environ else '127.0.0.1'
30
30
31
+ # sometimes docker seems to randomly hang for a default 60s, see
32
+ # https://github.com/docker/compose/issues/3927
33
+ # increase timeout in both compose in direct API calls
34
+ os .environ ['DOCKER_CLIENT_TIMEOUT' ] = '180'
35
+ os .environ ['COMPOSE_HTTP_TIMEOUT' ] = '180'
36
+
31
37
class MMTestCase (unittest .TestCase ):
32
38
@classmethod
33
39
def collectLogs (cls , referee = False ):
You can’t perform that action at this time.
0 commit comments