Browse code

Fix flaky test TestDaemonRestartRestoreBridgeNetwork

It checked for "Bind for 0.0.0.0:80 failed: port is already
allocated". But, since commit d662091 ("portallocator: always
check for ports allocated for 0.0.0.0/::"), the message is
sometimes about ":::80".

Signed-off-by: Rob Murray <rob.murray@docker.com>

Rob Murray authored on 2025/06/13 18:53:22
Showing 1 changed files
... ...
@@ -1691,8 +1691,8 @@ func (s *DockerDaemonSuite) TestDaemonRestartRestoreBridgeNetwork(t *testing.T)
1691 1691
 
1692 1692
 	// start a new container, trying to publish port 80:80 should fail
1693 1693
 	out, err := s.d.Cmd("run", "-p", "80:80", "-d", "busybox", "top")
1694
-	if err == nil || !strings.Contains(out, "Bind for 0.0.0.0:80 failed: port is already allocated") {
1695
-		t.Fatalf("80 port is allocated to old running container, it should failed on allocating to new container")
1694
+	if err == nil || !strings.Contains(out, "port is already allocated") {
1695
+		t.Fatalf("Expected 'port is already allocated', got err:%v out:%s", err, out)
1696 1696
 	}
1697 1697
 
1698 1698
 	// kill old running container and try to allocate again