Repository navigation
Windows tree tests start their ping through .NET: the cancel test no longer waits for PowerShell to read every module - #55
Merged
Conversation
… missing pid says what PowerShell said
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.
sys::tests::windows_cancel_kills_the_whole_treefailed at random on Windows ("the ping never started", 3 of ~60 runs: 38852822160, 38816142679, 38745678952).Cause (measured on fresh windows-latest VMs)
PSModuleAnalysisCachePath=C:\PSModuleAnalysisCachePath\ModuleAnalysisCache, a prebuilt module cache. The cancel test starts PowerShell throughrun_isolatedwith a short environment, which drops it, and the per-user default cache does not exist on the runner.Start-Process), Windows PowerShell then reads every module on its path (Az 15.6.1 and the rest). Stack of the stuck PowerShell:CommandDiscovery.TryModuleAutoDiscovery→AnalysisCache.AnalyzeManifestModule→Get-Module -ListAvailable→LoadBinaryModule.Start-Process: 22–60 s alone, 12–75 s while the other tests run; 0.1 s with the variable passed through. PowerShell saves its cache only seconds after the analysis, so a PowerShell the test kills right away never saves it: every run paid again. Past 60 s the watcher panicked without cancelling, and the test sat on untilrun_isolated's 120 s limit.Not a
run_isolateddefect: it passes exactly the environment it is given. On a user's PC the default cache is in the profile and warm, and the app's isolated program (Claude Code) is not PowerShell.Change (tests only)
Process.Startwith ShellExecute and a hidden window,File.WriteAllText): no module discovery, whatever the environment.wait_for_pidreturnsNoneinstead of panicking. The cancel test cancels in every case, and both tree tests fail with PowerShell's output, its exit code and the elapsed time.Proof (temporary workflow on this branch, removed in the last commit)
cargo test --libruns on 5 fresh VMs, no failure (38860347014).