Skip to content

test(windows): do not run TestNetworkInspectWithContainers in parallel - #5269

Merged
AkihiroSuda merged 1 commit into
containerd:mainfrom
0x000NULL:fix/4322-network-inspect-windows
Oct 27, 2026
Merged

AkihiroSuda merged 1 commit into
containerd:mainfrom
0x000NULL:fix/4322-network-inspect-windows

Conversation

@0x000NULL

Copy link
Copy Markdown
Contributor

Fixes #4322

On Windows, the subtests of TestNetworkInspectWithContainers each create nat networks and start a container on them, all in parallel (tigron runs tests in parallel unless NoParallel is set), together with the rest of the network package tests. One of them regularly fails with:

plugin type="nat" failed (add): hcnCreateNetwork failed in Win32: The object already exists. (0x1392)

#4360 added a one second sleep after network create. That did not fix it: the baseline runs below were made with the #4360 sleeps in place and still failed.

This sets NoParallel on the test and its subtests when running on Windows (NoParallel is not inherited by subtests, so each one needs it; this follows container_run_network_windows_test.go), and removes the sleeps in this test. Other platforms are unchanged. I left the sleep in TestNetworkInspectDualStack alone; it is skipped on Windows.

I have not identified the exact HNS race, only that serializing these tests makes it go away.

Testing

Runs on a fork (windows-2022, same job-test-in-host workflow, trimmed to the windows job):

Before (main):

With this change:

So 16/100 jobs hit 0x1392 without this change and 0/110 with it. The runs with this change also include the separate cni.sh fix (#5268), which does not touch this test.

go vet passes for the package on windows and linux, and gofmt is clean.

On Windows, the subtests of TestNetworkInspectWithContainers each create
nat networks and start containers on them concurrently, and one of them
regularly fails with "hcnCreateNetwork failed in Win32: The object already
exists. (0x1392)" (containerd#4322).

Run the test and its subtests sequentially on Windows, and drop the sleep
that was added after "network create" as a workaround.

Signed-off-by: Ethan Aldrich <ethan@ethanaldrich.net>
@AkihiroSuda AkihiroSuda added this to the v2.4.2 milestone Oct 27, 2026

@AkihiroSuda AkihiroSuda left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@AkihiroSuda
AkihiroSuda merged commit df3d4d4 into containerd:main Oct 27, 2026
64 of 74 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CI]: TestNetworkInspect is flaky in windows

2 participants