Skip to content

test(windows): avoid recovered nil-expander hardware faults - #4706

Merged
aheritier merged 1 commit into
mainfrom
fix/windows-expander-fault-recovery
Oct 22, 2026
Merged

aheritier merged 1 commit into
mainfrom
fix/windows-expander-fault-recovery

Conversation

@dgageot

@dgageot dgageot commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Why

TestCreateToolSetOK panicked inside the JSON encoder pool in a run right
after the parallel TestNilTemplateExpander started
(https://github.com/docker/docker-agent/actions/runs/39799565867/job/119896119973).
This matches the pattern already mitigated for the OpenAPI and toolinstall
packages in #4614: on Windows, recovering from the hardware-fault panics
these tests deliberately trigger (nil-receiver method calls) can corrupt
memory (golang/go#81238), which then surfaces as an unrelated failure in a
different, parallel test.

This is a mitigation, not a proven fix — the causal link to golang/go#81238
is strongly consistent with the symptoms but not conclusively established.

What

Extend the same narrow Windows skip used in #4614 to the two remaining
deliberate nil-receiver panic assertions:

  • pkg/tools/builtin/webhook/expander_test.go
  • pkg/tools/builtin/fetch/expander_test.go

Only the assert.Panics checks (which force the nil-receiver panic +
recover) are skipped on Windows, via a nested t.Run subtest. The safe
nil / typed-nil behavior checks (assert.Nil, assert.Equal) still run
unconditionally. All panic assertions are kept on non-Windows. No
production code changes.

Validation

  • task build, task test, task lint (Go 1.27.3, golangci-lint 2.14.0)
  • go test -race -shuffle=on -count=100 ./pkg/tools/builtin/fetch ./pkg/tools/builtin/webhook ./pkg/tools/builtin/openapi
  • Cross-compiled for Windows amd64

Native Windows CI passed on Go 1.27.3 windows/amd64:
https://github.com/docker/docker-agent/actions/runs/39802913848/job/119908396054

The test report confirms the safe nil / typed-nil subtests pass and only the
nested fault assertions skip. The full CI gate, Linux tests, lint, and
cross-compilation also passed. This single green run validates the intended
skip behavior, not definitive causality or elimination of every flake.

Windows can corrupt memory when recovering from a hardware fault
(golang/go#81238), so skip the nil-pointer panic checks there. This
mitigates the flake, it isn't a proven fix for the upstream issue.

Assisted-By: cagent
@dgageot
dgageot marked this pull request as ready for review October 22, 2026 15:27
@dgageot
dgageot requested a review from a team as a code owner October 22, 2026 15:27
@aheritier aheritier added area/tools For features/issues/fixes related to the usage of built-in and MCP tools kind/test Test-only changes labels Oct 22, 2026
@aheritier
aheritier added this pull request to the merge queue Oct 22, 2026
Merged via the queue into main with commit ed12bb7 Oct 22, 2026
16 checks passed
@aheritier
aheritier deleted the fix/windows-expander-fault-recovery branch October 22, 2026 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/tools For features/issues/fixes related to the usage of built-in and MCP tools kind/test Test-only changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants