Skip to content

Commit 0ea28fe

Browse files
committed
integration/networking: increase context timeout for attach
The TestNatNetworkICC and TestFlakyPortMappedHairpinWindows (TestPortMappedHairpinWindows) tests were frequently failing on Windows with a context timeout; === FAIL: github.com/docker/docker/integration/networking TestNatNetworkICC/User_defined_nat_network (9.67s) nat_windows_test.go:62: assertion failed: error is not nil: Post "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.51/containers/4357bd24c9b77b955ee961530d1f552ce099b3dcbeb396db599971b2396d8b08/start": context deadline exceeded panic.go:636: assertion failed: error is not nil: Error response from daemon: error while removing network: network mynat has active endpoints (name:"ctr2" id:"dc8d597dafef") === FAIL: github.com/docker/docker/integration/networking TestNatNetworkICC (18.34s) === FAIL: github.com/docker/docker/integration/networking TestFlakyPortMappedHairpinWindows (13.02s) nat_windows_test.go:110: assertion failed: error is not nil: Post "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.51/containers/65207ae3d6953d85cd2123feac45af60b059842d570d4f897ea53c813cba3cb4/start": context deadline exceeded panic.go:636: assertion failed: error is not nil: Error response from daemon: error while removing network: network clientnet has active endpoints (name:"amazing_visvesvaraya" id:"18add58d415e") These timeouts were set in c1ab6ed and 2df4391, and were shared between Linux and Windows; likely Windows is slower to start, so these timeouts to be expected. Let's increase the context timeout to give it a bit more time. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 8326491 commit 0ea28fe

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

integration/networking/nat_windows_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func TestNatNetworkICC(t *testing.T) {
5757
pingCmd := []string{"ping", "-n", "1", "-w", "3000", ctr1Name}
5858

5959
const ctr2Name = "ctr2"
60-
attachCtx, cancel := context.WithTimeout(ctx, 5*time.Second)
60+
attachCtx, cancel := context.WithTimeout(ctx, 15*time.Second)
6161
defer cancel()
6262
res := container.RunAttach(attachCtx, t, c,
6363
container.WithName(ctr2Name),
@@ -105,9 +105,9 @@ func TestFlakyPortMappedHairpinWindows(t *testing.T) {
105105
inspect := container.Inspect(ctx, t, c, serverId)
106106
hostPort := inspect.NetworkSettings.Ports["80/tcp"][0].HostPort
107107

108-
clientCtx, cancel := context.WithTimeout(ctx, 5*time.Second)
108+
attachCtx, cancel := context.WithTimeout(ctx, 15*time.Second)
109109
defer cancel()
110-
res := container.RunAttach(clientCtx, t, c,
110+
res := container.RunAttach(attachCtx, t, c,
111111
container.WithNetworkMode(clientNetName),
112112
container.WithCmd("wget", "http://"+hostAddr+":"+hostPort),
113113
)

0 commit comments

Comments
 (0)