Prevent flaky test by changing container names.

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
This commit is contained in:
Daniel Nephin 2015-08-26 18:55:22 -04:00
parent d264c2e33a
commit 235fe21fd0
3 changed files with 4 additions and 2 deletions

View File

@ -695,7 +695,7 @@ class ServiceTest(DockerClientTestCase):
Test that calling scale on a service that has a custom container name Test that calling scale on a service that has a custom container name
results in warning output. results in warning output.
""" """
service = self.create_service('web', container_name='custom-container') service = self.create_service('app', container_name='custom-container')
self.assertEqual(service.custom_container_name(), 'custom-container') self.assertEqual(service.custom_container_name(), 'custom-container')
service.scale(3) service.scale(3)

View File

@ -199,7 +199,6 @@ class ServiceStateTest(DockerClientTestCase):
self.assertEqual([c.is_running for c in containers], [False, True]) self.assertEqual([c.is_running for c in containers], [False, True])
web = self.create_service('web', **options)
self.assertEqual( self.assertEqual(
('start', containers[0:1]), ('start', containers[0:1]),
web.convergence_plan(), web.convergence_plan(),

View File

@ -33,6 +33,9 @@ class DockerClientTestCase(unittest.TestCase):
options = ServiceLoader(working_dir='.').make_service_dict(name, kwargs) options = ServiceLoader(working_dir='.').make_service_dict(name, kwargs)
labels = options.setdefault('labels', {})
labels['com.docker.compose.test-name'] = self.id()
return Service( return Service(
project='composetest', project='composetest',
client=self.client, client=self.client,