fix(xtask): eliminate nested-cargo build-lock stalls in workspace tests - #164
Merged
Conversation
Three check_dogfood_script tests spawned `cargo run -p xtask -- ...` as a child process to observe the xtask binary's real exit code, since a unit test's current_exe is the test runner, not xtask. That nested cargo invocation contends with the outer `cargo test --workspace` for Cargo's build-directory lock: on a cold build it stalled a full workspace test run for 20+ minutes (observed twice on 2026-07-19). Move xtask_check_dogfood_script_missing_sentinel, live_check_dogfood_script_fails_without_ff_rdp_live_tests_on_iter_branch, and live_check_dogfood_script_skips_on_main_without_ff_rdp_live_tests into a new integration test file (crates/xtask/tests/bin_exit_codes.rs), where CARGO_BIN_EXE_xtask lets them invoke the prebuilt binary directly with no nested cargo process at all. Function names and env-handling are unchanged so existing kb iteration-plan references to the live_* slugs still resolve. Remaining unit tests (run_inner-based happy/skip paths and extract_iteration_number) stay in the src module untouched.
…o run Same defect class as ae1fef0: xtask_check_iteration_ready_calls_dogfood_script was a unit test that spawned `cargo run -p xtask -- ...` as a child process to observe the binary's combined stdout/stderr, since current_exe inside a unit test is the test runner, not xtask. That nested cargo invocation runs during every `cargo test --workspace` and contends with the outer test run for Cargo's build-directory lock — the same stall hazard being eliminated here. Move the test into tests/bin_exit_codes.rs, invoking the prebuilt binary via CARGO_BIN_EXE_xtask (integration-test-only env var) with no nested cargo process. Function name and skip-list args are unchanged. check_iteration_ready.rs's own Command::new("cargo") (in run_xtask, its production sub-check dispatcher) is untouched — it's the real implementation, not a test-harness spawn, and falls back to cargo run only when current_exe isn't the xtask binary itself.
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.
Summary
cargo run -p xtaskchild to observe the binary's exit codes; nested cargo contends with the outercargo test --workspacefor the build-directory lock and stalled a cold workspace run 20+ minutes (observed twice on 2026-07-19, noted in iteration-124's out-of-scope).crates/xtask/tests/bin_exit_codes.rsinvoking the prebuilt binary viaCARGO_BIN_EXE_xtask— Cargo only sets that env var for integration tests, which is why the unit-test location had forced thecargo runworkaround.check_iteration_ready'srun_xtaskdispatcher fallback andcheck_pre_fix_repro's worktree-scopedcargo testruns are functional code, not test-harness nesting. Zero nested-cargo spawns remain in any src unit test.Test plan
cargo test --workspace -q: PASS in 1:47 wall, no stall (was 20+ min on cold builds)cargo test -p xtask -q: PASS, 14.3scargo fmt/cargo clippy --workspace --all-targets -- -D warnings: cleanlive_*slugs)🤖 Generated with Claude Code