Skip to content

reexec: fix flaky TestCommandContext on Windows - #282

Merged
thaJeztah merged 1 commit into
moby:mainfrom
kolyshkin:reexec-test-timeout
Nov 17, 2026
Merged

thaJeztah merged 1 commit into
moby:mainfrom
kolyshkin:reexec-test-timeout

Conversation

@kolyshkin

Copy link
Copy Markdown
Collaborator

All TestCommandContext subtests use a context with a 100ms timeout, but only the "context timeout" case needs it. On a slow CI runner (seen on windows-2025 in #281), a reexec'd child that should succeed can take longer than 100ms, the context expires, cmd.Cancel is called, and the test fails with:

reexec_test.go:372: unexpected error: exec: canceling Cmd: test-error: the command was canceled (out: Hello test-reexec2

Only set the timeout for the test case that needs it.

All TestCommandContext subtests use a context with a 100ms timeout,
but only the "context timeout" case needs it. On a slow CI runner
(seen on windows-2025), a reexec'd child that should succeed can take
longer than 100ms, the context expires, cmd.Cancel is called, and the
test fails with:

    reexec_test.go:372: unexpected error: exec: canceling Cmd: test-error: the command was canceled (out: Hello test-reexec2

Only set the timeout for the test case that needs it.

Signed-off-by: Kir Kolyshkin <[email protected]>

@thaJeztah thaJeztah 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.

LGTM, thx

@thaJeztah
thaJeztah merged commit 7938ac4 into moby:main Nov 17, 2026
25 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.

2 participants