Skip to content

test(storage): isolate broker custody fixtures from ambient disk samples - #5066

Merged
joelteply merged 1 commit into
canaryfrom
fix/d86-broker-volume-fixture
Oct 15, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fix/d86-broker-volume-fixture

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

The release-incremental broker fixture assumed its constructor budget forced pressure. That budget is only a fallback: the production pool now reads its owning volume from the shared monitor, so another test publishing a volume sample can remove broker admission between the locked and unlocked calls.

Keep the production monitor reader unchanged behind a private sample function and supply a measured critical volume in both real-broker fixtures. The release fixture asserts measured-volume admission and the actual release-lock decline before checking that 4096 bytes are reclaimed, while binaries, dependencies, build outputs and lock inode survive.

Validation: source diff check passed; hosted CI pending. No local compilation or live reclamation. The failing canary push 38771058840 had 8904 passing tests and only broker_reclaims_release_incremental_only_after_profile_custody failing (expected4096, got0); the binding check mirrored that failure. This PR does not waive the red push.

Existing owner: d86e79e8. Actual deployment and Kimi outcomes remain separate acceptance work.

@joelteply

Copy link
Copy Markdown
Contributor Author

Cormac on #5066 at 49ce9ba: source-approved, pending CI at this exact head. Read disk_eviction.rs; nothing run. Verified: CargoTargetPool.volume_sample defaults to DiskPressureMonitor::volume_for in new, so capacity_bytes and pressure read exactly what they read before in production. Only the two broker fixtures swap in critical_fixture_volume (available 0 of 100,000, so pressure 1.0 by volume), which removes their dependence on the process-global snapshot concurrent monitor tests publish. That was the 3d4a red (second relieve 0, expected 4096). The release fixture now proves it reached the real guard (last_decline == BuildHoldsReleaseLock) before it asserts the 4096 freed after release. That is the stronger assertion: it can no longer pass by never being admitted. Non-blocking: volume_sample is a production field that exists for tests; a #[cfg(test)] setter would keep it out of the release struct, but at fn-pointer size I would not block on it.

@joelteply
joelteply marked this pull request as ready for review October 15, 2026 17:56
@joelteply
joelteply merged commit 8eaed76 into canary Oct 15, 2026
7 checks passed
@joelteply
joelteply deleted the fix/d86-broker-volume-fixture branch October 15, 2026 17:56
joelteply added a commit that referenced this pull request Oct 20, 2026
…b3221a5)

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:
- paths::a_test_binary_never_resolves_the_operators_home
- persona_roster::the_roster_lists_staged_checkouts_and_never_an_in_flight_clone.
  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.
- code_commands::a_citizen_is_confined_to_her_workspace_and_the_operator_is_not
- docker::macos_with_home_resolves_to_docker_raw (macOS)
- forge::native_dry_run_resolves_spec_with_scale_from_alpha_over_rank (reads
  HOME, then the code under test expands ~ from HOME again)
- serving_daemon::an_engine_bound_to_live_work_is_never_replaced_under_it

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
joelteply added a commit that referenced this pull request Oct 20, 2026
…b3221a5)

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:
- paths::a_test_binary_never_resolves_the_operators_home
- persona_roster::the_roster_lists_staged_checkouts_and_never_an_in_flight_clone.
  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.
- code_commands::a_citizen_is_confined_to_her_workspace_and_the_operator_is_not
- docker::macos_with_home_resolves_to_docker_raw (macOS)
- forge::native_dry_run_resolves_spec_with_scale_from_alpha_over_rank (reads
  HOME, then the code under test expands ~ from HOME again)
- serving_daemon::an_engine_bound_to_live_work_is_never_replaced_under_it

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
joelteply added a commit that referenced this pull request Oct 20, 2026
…b3221a5)

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:
- paths::a_test_binary_never_resolves_the_operators_home
- persona_roster::the_roster_lists_staged_checkouts_and_never_an_in_flight_clone.
  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.
- code_commands::a_citizen_is_confined_to_her_workspace_and_the_operator_is_not
- docker::macos_with_home_resolves_to_docker_raw (macOS)
- forge::native_dry_run_resolves_spec_with_scale_from_alpha_over_rank (reads
  HOME, then the code under test expands ~ from HOME again)
- serving_daemon::an_engine_bound_to_live_work_is_never_replaced_under_it

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
joelteply added a commit that referenced this pull request Oct 21, 2026
…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 added a commit that referenced this pull request Oct 21, 2026
…ard cb3221a5) (#5069)

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.


Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant