Repository navigation
test: run gateway publication fixtures in child processes - #14779
Conversation
The five forge_gateway fixtures that drive Refresher::pass_with move the process-global DAEMON singleton (set_active), and their module mutex only orders publishers inside forge_gateway::tests: an unscoped reader-only read in any other fixture of the same process answers host_has_read_pool() with the synthetic gateway and sheds before its fake CLI can answer, so the claim-label fixtures read Unknown where they expect a classified label (parallel-only, 4/6 focused replays pre-change). Each publishing body now runs in a child copy of the test binary behind an exact opt-in selector (the hooks_home umask pattern); the public names stay as wrappers, so the default suite and focused filters exercise every body. The primary publisher's child also pins the retained production guard: with the synthetic gateway live, an unscoped claim-label read sheds (Unknown) and never consults an inert CLI. The claim fixture gains direct stub-execution evidence — a counting stub whose marker file proves the CLI ran. Production DAEMON, any_live(), host_has_read_pool() and reader-only routing are untouched; default Rust test parallelism is kept. Closes #14775
|
PR #14779's |
|
❌ Changes Requested Test-only diff, CI green at Blocking:
|
|
PR #14779's |
|
Fixed the child-run evidence finding at The original helper let the missing child return success. The corrected helper rejected that case, accepted one passing child, and surfaced a deliberate child failure in an isolated probe. All six focused parallel replays and 163 default-parallel fixture tests passed. The five isolated child bodies still run through their wrappers. Formatting and diff checks passed. The final base update changed two MCP files, and the focused gateway, claim, and missing-child tests passed again against the same tested Rust files. Exact hosted CI |
|
PR #14779's |
|
Approved The new helper requires a successful child process and a libtest summary with one passing test. I extracted the helper and permanent regression test from the signed revision and ran three inert Rust checks. They verified that one passing child succeeds, a missing selector with exit 0 is rejected, and an actual child failure reports both output streams. All five gateway fixture wrappers target different ignored bodies. The production reader-only routing is unchanged. The publisher still checks that a live synthetic gateway sheds an unscoped read, and the separate claim fixture proves its stub was invoked. The two test-file changes compose cleanly with current main Formal review reconciliation (#7647) — 7038741514: Fixed at loom-daemon/src/forge_gateway/tests.rs:30-58. All five wrappers now require one passing test and log both streams. The permanent missing-child test confirms that the exit-0 zero-test case is refused. An independent failing child also surfaced its named result, stdout, and stderr. |
|
PR #14779's |
|
Champion Auto-Merge This PR meets all safety criteria for automatic merging:
Proceeding with merge... If this was merged in error, you can revert with: Automated by Champion role |
Summary
The five
forge_gatewayfixtures that driveRefresher::pass_withmove the process-globalDAEMONsingleton (set_active), and the module'sserial()mutex only orders publishers insideforge_gateway::tests. An unscoped reader-only read in any other fixture of the same process answershost_has_read_pool()with the synthetic gateway (any_live()) and sheds before its fake CLI can answer — so the claim-label fixtures readUnknownwhere they expect a classified label, parallel-only.Each publishing fixture body now runs in a child copy of the test binary behind an exact opt-in selector (the
hooks_homeumask-child pattern,hooks_home_tests.rs); the public test names stay as wrappers, so the default suite and focused filters still exercise every body. The primary publisher's child also pins the retained production guard: with the synthetic gateway live, an unscoped claim-label read sheds (Unknown) and never consults an inert CLI. The claim fixture gains direct stub-execution evidence — a counting stub whose marker file proves the CLI actually ran.Closes #14775
Changes
loom-daemon/src/forge_gateway/tests.rs—in_a_child_processhelper; the fivepass_withfixtures (a_pass_publishes_each_owner_and_rewrites_api_host_on_every_publish,a_replaced_gh_is_reported_on_the_next_refresh,an_old_gh_publishes_nothing_and_removes_what_was_there,a_dropped_owner_s_profile_is_removed,with_the_gateway_unset_routing_is_byte_identical_to_today) become wrappers over#[ignore]d child bodies; the primary publisher's child asserts the live-route shed control (unscoped read sheds, inert CLI never invoked).loom-daemon/src/forge_check_claim.rs—read_claim_labels_distinguishes_claimed_clean_and_unknowngains a counting stub asserting the stub itself executed alongside its label classification.Production
DAEMON,any_live(),host_has_read_pool()and reader-only routing are untouched; default Rust test parallelism and the pooled-reader / no-pool controls (reader_only_tests.rs) are kept as-is.Acceptance Criteria Verification
f8f031568— the focused pair run with--test-threads=2(owner-only canonicalTMPDIR, offline stub CLIs) failedread_claim_labels_distinguishes_claimed_clean_and_unknownin 4 of 6 invocations (left: Unknownat theAwaitingCurator/claim asserts), passing serially — the exact failure filed.pass_withfixture body runs in its own child process; each child executes the original publication/profile/disable/cleanup assertions verbatim with its own tempdir, the existingFakedeps and an inert CLI. All five child bodies pass under the wrappers' exact selectors (--exact forge_gateway::tests::<name>_child --ignored --test-threads=1, 1 passed each).Cleanclassification and that its marker file exists — direct stub-execution evidence.any_live()true → unscopedread_claim_labels=Unknown, inert CLI marker absent). No production code changed; default test parallelism kept.forge_gateway+forge_check_claim+reader_only+reader_routefilters in one process, default parallelism: 109 passed, 0 failed (5 ignored = the child bodies, exercised via their wrappers). Note: 4front_base/cli_baseprivacy tests also fail identically on the unmodified main binary on this host — this worker's umask is0002, sostd::fs::write-created marker files are group-writable andsafe_base's private-file check refuses them; underumask 022the combined run is fully green. Pre-existing host artifact, unrelated to and untouched by this change.Test Plan
cargo test -p loom-daemon --lib --no-run(worktree-localCARGO_TARGET_DIR), focused interleaving ×6, child bodies ×5, combined suites — all green.cargo clippy --package loom-daemon --all-targetswith CI's exact flag set: clean.cargo fmtapplied;git diff --checkclean.loom dashboard