Skip to content

Give the terminate tests a margin, without letting them stop failing - #797

Merged
SimonCropp merged 1 commit into
mainfrom
fix-terminate-process-test-margins
Aug 22, 2026
Merged

Give the terminate tests a margin, without letting them stop failing#797
SimonCropp merged 1 commit into
mainfrom
fix-terminate-process-test-margins

Conversation

@SimonCropp

Copy link
Copy Markdown
Member

Both asserted WaitForExit(1000) after terminating a process. One second is a bet
on the runner being idle, and on a loaded two core Windows runner it is not: the
pair went red on main, and a re-run with no code change went green.

Widening alone would have been wrong for the non-windowed case. That
FakeDiffTool sleeps five seconds and then exits by itself, so any wait past five
seconds passes whether the process was terminated or merely ran out - the same
trap LaunchAndKill was in. So that one also asserts the exit code:
TryTerminateProcess passes -1 to TerminateProcess, and running out returns 0.

The windowed case needs no such guard, since a windowed FakeDiffTool runs until
something closes it. Waiting longer there cannot turn a failure into a pass.

Checked by making TryTerminateProcess skip the terminate: both tests fail, one
on the exit code and one on the wait.

Both asserted WaitForExit(1000) after terminating a process. One second is a bet
on the runner being idle, and on a loaded two core Windows runner it is not: the
pair went red on main, and a re-run with no code change went green.

Widening alone would have been wrong for the non-windowed case. That
FakeDiffTool sleeps five seconds and then exits by itself, so any wait past five
seconds passes whether the process was terminated or merely ran out - the same
trap LaunchAndKill was in. So that one also asserts the exit code:
TryTerminateProcess passes -1 to TerminateProcess, and running out returns 0.

The windowed case needs no such guard, since a windowed FakeDiffTool runs until
something closes it. Waiting longer there cannot turn a failure into a pass.

Checked by making TryTerminateProcess skip the terminate: both tests fail, one
on the exit code and one on the wait.
@SimonCropp
SimonCropp merged commit 8faf6dc into main Aug 22, 2026
9 checks passed
@SimonCropp
SimonCropp deleted the fix-terminate-process-test-margins branch August 22, 2026 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant