diff options
author | Joffrey F <joffrey@docker.com> | 2017-05-09 17:18:46 -0700 |
---|---|---|
committer | Joffrey F <joffrey@docker.com> | 2017-05-09 17:18:46 -0700 |
commit | 6ed0c010189dc4d0ffb0511ae145346bfdc49117 (patch) | |
tree | 2075896151bdec21cf93a177361537e0cb48ef59 /tests/integration | |
parent | 2bdaf7f857645244ff38defe61feecbf9af11d68 (diff) | |
download | docker-py-test_17.05_engine.tar.gz |
Adjust tests and add newest engine version to Jenkinsfiletest_17.05_engine
Signed-off-by: Joffrey F <joffrey@docker.com>
Diffstat (limited to 'tests/integration')
-rw-r--r-- | tests/integration/api_service_test.py | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/tests/integration/api_service_test.py b/tests/integration/api_service_test.py index 6858ad0..914e516 100644 --- a/tests/integration/api_service_test.py +++ b/tests/integration/api_service_test.py @@ -103,18 +103,28 @@ class ServiceTest(BaseAPIIntegrationTest): assert services[0]['ID'] == svc_id['ID'] @requires_api_version('1.25') - @requires_experimental + @requires_experimental(until='1.29') def test_service_logs(self): name, svc_id = self.create_simple_service() assert self.get_service_container(name, include_stopped=True) - logs = self.client.service_logs(svc_id, stdout=True, is_tty=False) - log_line = next(logs) + attempts = 20 + while True: + if attempts == 0: + self.fail('No service logs produced by endpoint') + return + logs = self.client.service_logs(svc_id, stdout=True, is_tty=False) + try: + log_line = next(logs) + except StopIteration: + attempts -= 1 + time.sleep(0.1) + continue + else: + break + if six.PY3: log_line = log_line.decode('utf-8') assert 'hello\n' in log_line - assert 'com.docker.swarm.service.id={}'.format( - svc_id['ID'] - ) in log_line def test_create_service_custom_log_driver(self): container_spec = docker.types.ContainerSpec( |