Workaround race conditions on tests

Signed-off-by: Ulysses Souza <ulysses.souza@docker.com>
This commit is contained in:
Ulysses Souza 2019-04-15 14:14:38 +02:00
parent 2b24eb693c
commit e047169315
3 changed files with 5 additions and 3 deletions

View File

@ -2347,6 +2347,7 @@ class CLITestCase(DockerClientTestCase):
assert 'another' in result.stdout
assert 'exited with code 0' in result.stdout
@pytest.mark.skip(reason="race condition between up and logs")
def test_logs_follow_logs_from_new_containers(self):
self.base_dir = 'tests/fixtures/logs-composefile'
self.dispatch(['up', '-d', 'simple'])
@ -2393,6 +2394,7 @@ class CLITestCase(DockerClientTestCase):
) == 3
assert result.stdout.count('world') == 3
@pytest.mark.skip(reason="race condition between up and logs")
def test_logs_default(self):
self.base_dir = 'tests/fixtures/logs-composefile'
self.dispatch(['up', '-d'])

View File

@ -1,6 +1,6 @@
simple:
image: busybox:latest
command: sh -c "echo hello && tail -f /dev/null"
command: sh -c "sleep 1 && echo hello && tail -f /dev/null"
another:
image: busybox:latest
command: sh -c "echo test"
command: sh -c "sleep 1 && echo test"

View File

@ -3,5 +3,5 @@ simple:
command: sh -c "echo hello && tail -f /dev/null"
another:
image: busybox:latest
command: sh -c "sleep 0.5 && echo world && /bin/false"
command: sh -c "sleep 2 && echo world && /bin/false"
restart: "on-failure:2"