Repository navigation
Run section AH's keyword cases in child processes, with a dump on a timeout - #108
Merged
Merged
Conversation
…imeout Each 'continue'/'break' case ran in a [PowerShell] inside the harness's own process, with a 20 s wait. On a timeout the harness called Stop(), which waits for the case to stop; a case blocked in a .NET wait never does, so a hung case hung the whole run with no [FAIL]. Each case now runs in a PowerShell process of its own with a 30 s limit. One that runs past it is killed by PID with its tree, fails naming the case and the programs it had running, and leaves a full minidump of its process (MiniDumpWriteDump) in %TEMP%\pk-harness-dumps or PK_HARNESS_DUMP_DIR. CI uploads that folder when the harness fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong
Section AH runs each
continue/breakkeyword case in a[PowerShell]inside the harness's own process and waits 20 s for it. On a timeout the harness called$ps.Stop(), which waits for the case to stop. A case blocked in a .NET wait never stops, so instead of a[FAIL]the whole run hung until the job's time limit. That happened once on CI, in the'break'in-JobPollCompletedcase under PowerShell 7. It passed on a rerun and hasn't been reproduced, so its cause isn't known.What changed
MiniDumpWriteDump, nothing installed) to%TEMP%\pk-harness-dumps, or toPK_HARNESS_DUMP_DIRif that's set;taskkill /T), even if steps 1 or 2 fail;ping.exechild is listed and killed with it.tests.ymlandmodule.ymlsetPK_HARNESS_DUMP_DIRand upload that folder as an artifact when the harness fails (7 days).Moving the cases out of the harness's process changes their conditions. If the CI hang depended on something in that process, it may not happen again this way.
How it was tested
-AsModule -Section MODULE: 292 assertions passed on both.ManualResetEvent.WaitOne(), added locally and not committed:main, the harness hung after that case'scontinueline, with no[FAIL], until it was killed at 150 s. That's the same thing CI showed.dotnet-dump analyzeon that dump showed the stuck thread inWaitHandle.WaitOne(). TheFunctionContextobjects on its stack named the PowerShell call chain, innermost first: the callback, thenInvoke-PkProcessDispatchCore,Invoke-PkProcessDispatchandInvoke-KwDispatch.🤖 Generated with Claude Code