fix: prevent PID-reuse flake in capture survival checks - #16
Merged
Merged
Conversation
The observed failure was 'test-created process survived: 1364' at the $CreatedPids loop, not the timeout-witness path. Each capture already records completed_utc.txt; a process with a recorded PID whose StartTime is later than the capture's completion can't be the original child. - Test-ProcessSurvivedCaptureChild: survives only if PID exists AND StartTime <= capture completed_utc - $CreatedPids loop now tracks PID -> CaptureDirectory and uses the completion-aware check - Diagnostic-child check uses the same completion-aware logic - Add Test-ProcessSurvivedCaptureChildRegression covering: start before completion (survives), start after completion (PID reuse, not survived), non-existent PID, missing completion record
undergroundrap
marked this pull request as ready for review
September 23, 2026 07:04
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.
Summary
Fixes the PID-reuse flake observed in run 35801511864 (Windows job 106992677604).
The capture survival checks used
Get-Process -Id $PIDwhich returns a processif ANY process has that PID — including a different process that reused the PID
after the original exited. This caused false "survived" failures.
Fix
parent_startanddescendant_startalongside PID witnesses)Test-ProcessSurvivedhelper: a process survives only if PID exists ANDstart time matches the recorded value
Test-ProcessSurvivedPidReuseRegression: verifies same PID with differentstart time is NOT reported as survived
Testing
ok - Test-ProcessSurvived PID-reuse regression