From 7d22eb072cd277048e678d6244e5fb395b34f1ff Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 8 Jun 2016 23:09:20 +0200 Subject: [PATCH] fix TestEventsContainerWithMultiNetwork the order in which disconnect takes place is undetermined, so don't check for the full name this test was passing due to a previous bug, that always returned the same network-name. this bug was recently fixed in 148bcda3292563df8e433a3d7987810cd5702dec (pull request 23375), exposing this test to be flaky. Signed-off-by: Sebastiaan van Stijn --- integration-cli/docker_cli_events_unix_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/integration-cli/docker_cli_events_unix_test.go b/integration-cli/docker_cli_events_unix_test.go index 3417d7abf6..d0a25ed2bf 100644 --- a/integration-cli/docker_cli_events_unix_test.go +++ b/integration-cli/docker_cli_events_unix_test.go @@ -244,12 +244,14 @@ func (s *DockerSuite) TestEventsContainerWithMultiNetwork(c *check.C) { out, _ := dockerCmd(c, "events", "--since", since, "--until", until, "-f", "type=network") netEvents := strings.Split(strings.TrimSpace(out), "\n") + // NOTE: order in which disconnect takes place is undetermined, + // so don't check for the *full* name c.Assert(len(netEvents), checker.Equals, 2) c.Assert(netEvents[0], checker.Contains, "disconnect") - c.Assert(netEvents[0], checker.Contains, "test-event-network-local-1") + c.Assert(netEvents[0], checker.Contains, "test-event-network-local-") c.Assert(netEvents[1], checker.Contains, "disconnect") - c.Assert(netEvents[1], checker.Contains, "test-event-network-local-2") + c.Assert(netEvents[1], checker.Contains, "test-event-network-local-") } func (s *DockerSuite) TestEventsStreaming(c *check.C) {