Repository navigation
test: tests that READ the process home hold the one home lock (card cb3221a5) - #5069
Merged
joelteply merged 1 commit intoOct 21, 2026
Merged
Conversation
joelteply
force-pushed
the
cb3221a5/audit-lib-tests-that-read-process-global
branch
from
October 20, 2026 01:47
c9e2aa3 to
fb25fad
Compare
joelteply
force-pushed
the
cb3221a5/audit-lib-tests-that-read-process-global
branch
2 times, most recently
from
October 20, 2026 03:34
74d1fb9 to
8ebbde7
Compare
…ard cb3221a5) Re-ported onto canary 445ae4b after the #5245 file splits. Three flaky lib tests in a row turned canary red and refused every node's deploy on 2026-10-15 (#5066, #5067): tests that only READ the process home (continuum_home, HOME, home_dir) took no lock, so a guarded fixture could swap the home between two reads. Five readers take HomeGuard::preserve_blocking() (one async test takes preserve().await). The probe-env pair (tracing_init, probe_file_sink) both set/remove CONTINUUM_PROBE_DIR/CLASSES unlocked and restore each other's values mid-assertion; they take the same lock. test_env's doc says the ONE lock covers every test that mutates process env, so there is one env lock, not one per variable. The earlier forge test move is dropped: canary already split modules/forge. No production change. source-hygiene 43/43 on IntelMac, no baseline change. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
joelteply
force-pushed
the
cb3221a5/audit-lib-tests-that-read-process-global
branch
from
October 21, 2026 17:06
8ebbde7 to
0dbddb8
Compare
Contributor
Author
|
Source PASS at exact 0dbddb8. Reviewed the full delta and existing HomeGuard lifetime/drop behavior plus the engine-bound test. The sync helper acquires the same owned mutex as async preservation and does not alter environment values; sync tests use blocking acquisition and the Tokio test awaits acquisition. The added guards span the reads or save/mutate/restore sequence, preventing those participating fixtures from racing home changes. This is test isolation, not a production behavior change or a claim that all environment accesses are now guarded. Integration still requires green current-head CI. No local tests run on this serving node. |
joelteply
deleted the
cb3221a5/audit-lib-tests-that-read-process-global
branch
October 21, 2026 17:59
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.
Three flaky lib tests in a row turned canary red and refused every node's
deploy on 2026-10-15: the broker volume snapshot (#5066), a one-shot process
table read (#5067) and CONTINUUM_HOME swapped by a concurrent fixture (#5067).
The home class is the one test_env already owns: HomeGuard serializes every
test that WRITES the home, but tests that only READ it (continuum_home, HOME,
home_dir) took no lock, so a guarded fixture could swap the home between two
of their reads.
An audit of continuum-core's default-suite tests that read the home without
a guard found six; four more are #[ignore]d hardware tests, and data.rs's is
fixed in #5067:
Its "CONTINUUM_HOME is set, skip" check could pass vacuously under a
concurrent fixture, or pass the check and then write under that fixture's home.
HOME, then the code under test expands ~ from HOME again)
Each takes HomeGuard::preserve (async) or the new preserve_blocking (sync,
the twin of set_blocking), which holds the restored process home unchanged
for the test's life. No production change; every edit is one guard line.
Next on the card: the CONTINUUM_PROBE_DIR/CLASSES pair, mutated unlocked by
tracing_init::from_env_reads_documented_env_vars and
probe_file_sink's env test and read by persona/live_state.
Co-Authored-By: Claude Opus 5.5 (1M context) [email protected]
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE