Fix race condition in integration regression tests

`docker port` and inspect do not return ports for containers which are
not running. Because the container command is `true`, sometimes that
exits before the inspect is called.

Signed-off-by: Paul Bellamy <paul.a.bellamy@gmail.com>
This commit is contained in:
Paul Bellamy 2015-10-01 14:02:16 +01:00
parent 7884ab9fe2
commit 19291ee20d
1 changed files with 1 additions and 1 deletions

View File

@ -1762,7 +1762,7 @@ class TestRegressions(BaseTestCase):
tcp_port, udp_port = random.sample(range(9999, 32000), 2) tcp_port, udp_port = random.sample(range(9999, 32000), 2)
ctnr = self.client.create_container( ctnr = self.client.create_container(
BUSYBOX, 'true', ports=[2000, (2000, 'udp')], BUSYBOX, ['sleep', '9999'], ports=[2000, (2000, 'udp')],
host_config=self.client.create_host_config( host_config=self.client.create_host_config(
port_bindings={'2000/tcp': tcp_port, '2000/udp': udp_port} port_bindings={'2000/tcp': tcp_port, '2000/udp': udp_port}
) )