test: give the Windows descendant probe its own budget - #2055
Merged
Conversation
When a suite leader has already exited, taskkill /T cannot walk its tree, so run-test-wave.py proves cleanup by asking Windows whether anything is still parented to the dead PID. That probe was timed with --kill-grace, which the parallel gate passes as 1s. A cold powershell.exe + CIM start routinely costs more than that on a runner, so TimeoutExpired -- a fact about interpreter start-up, not about the process tree -- was read as "assume the worst" and failed an already-clean shard with exit 2. Give the probe its own stable-state budget (15s) plus one retry, keeping the fail-closed semantics: an exhausted or failed probe still counts as "cannot prove absence". The refusal now names which of the two happened, an unfinished probe or a counted set of live descendants, instead of reporting both as a leaked tree. The contract test pins this structurally -- no sleeps, no timing thresholds: the probe must be bounded by the module constant rather than by the kill-grace argument, must retry a timed-out probe, must never read an unusable probe as absence, and must report the two failures distinctly. Its Windows leader-exit case now waits on the scheduler's refusal rather than on a deadline shorter than the new budget. Refs #1741 Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
DeusData
force-pushed
the
fix/test-wave-descendant-probe-budget
branch
from
September 4, 2026 15:58
36bee90 to
132e8fc
Compare
4 tasks
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.
When a suite leader has already exited,
taskkill /Tcannot walk its tree, soscripts/run-test-wave.pyproves cleanup by asking Windows whether anything is still parented to the dead PID. That PowerShell/CIM probe was timed with--kill-grace, which the parallel gate passes as1. A coldpowershell.exestart routinely costs more than a second on a GitHub Windows runner, soTimeoutExpired— a fact about interpreter start-up, not about the process tree — was mapped to "assume the worst" and failed an already-clean shard with exit 2. Since the probe's latency is unrelated to the state it reports, the proof was probabilistic.This gives the probe its own stable-state budget (
WINDOWS_DESCENDANT_PROBE_SECONDS = 15) plus one retry, and keeps the fail-closed semantics: an exhausted or failed probe still counts as "cannot prove absence". The refusal now names which of the two actually happened — an unfinished probe, or a counted set of live descendants — instead of reporting both as a leaked tree.Observed on run 33879421262, job 101064442018 (step "parallel suite scheduler contract", CLANG64 x86_64 shard 2/2), on a PR that only touched
scripts/hooks/pre-commit; the same leg passed on another PR the same hour. Refs #1741.Contract pin (deterministic, no sleeps, no timing thresholds).
tests/test_parallel_harness_contract.shnow asserts structurally that the probe is bounded by the module constant rather than by the kill-grace argument, that it retries a timed-out probe, that an unusable probe is never read as absence, and that the two failures are reported distinctly. Its Windows leader-exit case waits on the scheduler's refusal instead of on a deadline that is now shorter than the probe budget.Verification. macOS: the full contract test passes unchanged (all pre-existing cases green),
python3 -m py_compile scripts/run-test-wave.pyclean, and the new assertions were revert-checked against four mutations (no retry, kill-grace-sized budget, merged failure message, fail-open probe) — each is caught.make -f Makefile.cbm lint-ciis C-only (cppcheck + clang-format overLINT_SRCS/LINT_HDRS), so it does not coverscripts/; no Python linter runs in CI.Honest limit. The Windows branch cannot execute on macOS — the new probe path itself is exercised here only through the injected-failure assertions. This PR's Windows leg is the confirmation.