Merge pull request #2722 from aanand/fix-scale-race-condition

Fix scale race condition
This commit is contained in:
Aanand Prasad 2016-01-21 17:08:15 +00:00
commit 1e51b7e88b
2 changed files with 16 additions and 6 deletions

View file

@ -746,6 +746,11 @@ class ServiceTest(DockerClientTestCase):
for container in containers:
self.assertEqual(list(container.inspect()['HostConfig']['PortBindings'].keys()), ['8000/tcp'])
def test_scale_with_immediate_exit(self):
service = self.create_service('web', image='busybox', command='true')
service.scale(2)
assert len(service.containers(stopped=True)) == 2
def test_network_mode_none(self):
service = self.create_service('web', net=Net('none'))
container = create_and_start_container(service)