Skip to content

Fix flaky CI on windows - #13827

Merged
mxpv merged 2 commits into
containerd:mainfrom
mxpv:windows
Jul 22, 2026
Merged

mxpv merged 2 commits into
containerd:mainfrom
mxpv:windows

Conversation

@mxpv

@mxpv mxpv commented Jul 22, 2026 •

Copy link
Copy Markdown
Member

Fix flaky Windows tests:

  • Fix hcnCreateNetwork failed in Win32: Element not found - 1, 2, 3
  • Fix output `` does not contain \x00 - 1

Copilot AI review requested due to automatic review settings July 22, 2026 03:05
@github-project-automation github-project-automation Bot moved this to Needs Triage in Pull Request Review Jul 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Windows CI workflow to reduce intermittent failures on windows-2022 by explicitly starting Docker before running the Windows CNI installation step (to ensure the nat HNS network is created).

Changes:

  • Add a PowerShell step in the Windows integration job to start the docker Windows service before script/setup/install-cni-windows.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci.yml Resolved
Copilot AI review requested due to automatic review settings July 22, 2026 04:03
@kubernetes-prow kubernetes-prow Bot added size/M and removed size/XS labels Jul 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread integration/client/container_test.go Resolved
Copilot AI review requested due to automatic review settings July 22, 2026 04:11
@mxpv mxpv changed the title Fix CI on windows Fix flaky CI on windows Jul 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

integration/client/container_test.go:2789

  • strings.ContainsRune(out, 0) makes this test require an actual NUL byte in the captured output. On non-Windows, withProcessArgs("echo", "hello") runs directly in BusyBox (see integration/client/helpers_unix_test.go:40-42), and PTY output is typically plain text without NUL bytes, so this assertion is likely to fail cross-platform. The previous check also didn’t actually test for a NUL byte because strings.ContainsAny(..., "\\x00") only checks for any of the characters \\, x, or 0.

Consider normalizing the output by stripping any NUL bytes (if present on Windows), trimming the trailing newline, and asserting the expected text instead.

	out := buf.String()
	if !strings.ContainsRune(out, 0) {
		t.Fatalf("expected NUL byte in output, got %#q", out)
	}

Copilot AI review requested due to automatic review settings July 22, 2026 04:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

integration/client/container_test.go:2788

  • The null-byte assertion is currently incorrect: strings.ContainsAny(..., \x00) checks for any one character in the set {\, x, 0}, not the substring \x00. This can produce false positives (e.g., any output containing x or 0) and doesn’t reliably validate the intended condition.
	out := buf.String()
	if !strings.ContainsAny(fmt.Sprintf("%#q", out), `\x00`) {
		t.Fatalf(`expected \x00 in output, got %#q`, out)

// Otherwise there is a race between the IO copy goroutine writing to buf
// and the read below, which is flaky on Windows named pipes. Wait must be
// called before Delete, which cancels the IO.
task.IO().Wait()

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.

Good one.

@github-project-automation github-project-automation Bot moved this from Needs Triage to Review In Progress in Pull Request Review Jul 22, 2026
@fuweid
fuweid added this pull request to the merge queue Jul 22, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 22, 2026
@mxpv
mxpv added this pull request to the merge queue Jul 22, 2026
Merged via the queue into containerd:main with commit e05f673 Jul 22, 2026
86 of 90 checks passed
@github-project-automation github-project-automation Bot moved this from Review In Progress to Done in Pull Request Review Jul 22, 2026
@mxpv
mxpv deleted the windows branch July 22, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants