Repository navigation
test: initialize supervisor before timeout cleanup checks - #292
kevin-orellana wants to merge 3 commits into
Conversation
## Problem The cleanup regression starts its readiness deadline before the Python supervisor initializes. A slow startup can leave workload.pid absent, so the test fails before it checks descendant cleanup. ## Solution Publish a fixture startup marker after installing the shutdown handler and writing both process identity files. Wait for that marker before exercising the shared private readiness wait. Preserve the timeout panic, graceful descendant shutdown, and supervisor-reaping assertions. ## Tests Native macOS: 103 standalone harness library tests pass. Linux ARM64: 104 pass. All-feature and no-default builds, strict all-target Clippy, formatting, and whitespace checks pass on both platforms. when_readiness_times_out_then_shutdown_reaps_the_separate_workload fails with a two-second startup delay before the fix and passes after it. The same test rejects immediate termination and a removed readiness wait. Independent adversarial review found no actionable defect in the repair. The broader scripts/test-all.sh check fails on unchanged Linux test compilation tracked in #289. Full deterministic integration validation requires isolated hosted fixtures; shared local fixtures were preserved.
|
Assessment: Comment The startup gate fixes the macOS race. The new test, however, no longer exercises the helper whose readiness-timeout cleanup it is named for. A local mutation shows the cleanup regression it used to catch now passes (see the inline comment). Checks that held
The PR description gives a clear account of the race and of the controls behind the fix. |
|
Assessment: Approve (re-review at The test runs the full helper again, with a 10 s readiness budget. My earlier coverage finding is resolved, and the startup race is gone. Checks that held
Before merge: The PR description still describes the previous approach: a separate startup gate, then a direct 100 ms |
Human readable section
Problem. A cleanup test starts its one-second readiness timeout before its Python supervisor initializes. A slow start can stop the fixture before it writes its process identity files. The test then fails before it can check cleanup. This matched the macOS failure in #262.
Solution. Give the fixture ten seconds to initialize while testing the full execution helper's readiness-timeout path. The fixture never sends the workload-ready signal, so the helper must time out. The test checks that initialization completed, the callback never ran, and shutdown stopped the separate workload and collected its exit status. It also checks that the helper collected the supervisor's exit status.
Trade-off. This timeout test takes about ten seconds. A startup failure still fails the test. Normal harness timeouts and product launcher behavior do not change.
Description
Keep the existing readiness loop in a private
WorkloadChildmethod. The regression reaches that loop throughspawn_meanwhile_with_timeouts, which owns timeout cleanup. Preserve the checks for the expected timeout, fixture initialization, callback refusal, and separate-workload cleanup.The correction in
2349ba8restores helper-level coverage identified by automated review. A mutation that force-kills the supervisor during the helper's readiness error now fails the regression.Related Issues
Discovered in #262's macOS test failure.
Type of Change
Bug fix
Testing
Current revision:
2349ba8c1b84768f8681686d45df9137a82d8324The branch includes main at
67e378ae16f2a8457a6b856228343086f404e743, including #288's compiler and Python metadata repairs. This correction changes onlytest-integ/src/process/tests.rsrelative to the refreshed head3b1ada0.Verified locally on Linux ARM64 with a separate harness build directory:
process::tests passed, with zero failures or ignored tests. The other 93 library tests were filtered out.workload_alive=true. This verifies the cleanup coverage identified by review.Fresh required CI and CodeQL passed at this revision. The hosted checkout tree matched the pushed head.
The automated reviewer repeated the mutation and delayed-startup controls and accepted the repair. The coverage discussion is resolved. The description now reflects the full helper path, ten-second cost, and current revision.
Earlier full run at
3b1ada0Full hosted CI passed before this final test correction. Linux ARM64 and macOS workspace tests passed, along with lint, packaging, native macOS tests, site manifest, Verdict, and CI Gate.
The standalone harness passed all 104 Linux and 103 macOS library tests, with none ignored or filtered. Deterministic integration recorded all 140 expected cases: Linux had 131 passes and nine platform skips; macOS had 128 passes and twelve platform skips. Neither platform recorded a failure or setup error.
That full run covers the earlier revision. No new local full-workspace or native macOS run is claimed for the final correction. The package has a standalone manifest; workspace-only commands do not run its tests.
Existing platform gaps remain reported by the hosted jobs. Linux cannot exercise the alias read-only assertion or a real credential-daemon fixture. Existing ignored Rust tests and the ignored harness documentation test remain outside the passing counts.
Checklist
The change affects private test-harness code. It changes no documented product interface or build command.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.