Repository navigation
ci: reduce cold builds and unnecessary runner work - #941
Merged
Merged
Conversation
A Windows child inherits every inheritable handle of its parent, so a git that outlived a test process held nextest's output pipes open and the test was reported as leaky. The process helpers now take tcode's standard handles out of that set once; Stdio::inherit still hands them over through std's own inheritable duplicates.
run_until_parked waited out a 50/250 ms quiet window: a guess at how long background work takes, which loaded runners overrun. It now runs what is queued, barriers the store writer and returns. The tests that relied on the window wait for the state they assert instead: - sweep lets a running sync finish, since a sweep that finds one is skipped - an orchestration Cancel waits for its reply - a cold read and a subscription wait for the whole log after the bounded read answers first - provider events wait for the host to take or act on them - the native mirror waits for its last reply as well as its turn end
The Forge trait takes the lookup itself: checkout_repository and discover receive a Checkout, so routing through the hosts and the chosen host's discovery read the remotes once, and the second trait method that only forwarded to the first is gone. A branch checked out at the project root reuses the root's listing, branch_head and read_status read theirs once, and GitHub maps remotes through the shared parser instead of a copy of it.
- Each platform's Clippy and tests are two jobs, and its required check waits for those two alone, so a failure names the platform it happened on instead of failing one gate and cancelling the others. - Clippy restores the test cache instead of saving a cache of its own. - Leaked output handles fail in the default nextest profile, so the documented local command and CI judge them the same way. - Windows uses two test slots per CPU like the other runners, now that children no longer inherit the test process's output pipes.
This was referenced Oct 24, 2026
Tryanks
added a commit
that referenced
this pull request
Oct 24, 2026
#962) GitHub creates a job that waits on others only once they finish. Since #941 CI's required platform checks are such jobs, so for minutes at a time the head showed every required check reported so far as passed while macOS arm64 and Windows x64 did not exist yet, and the watch woke the agent mid-run. When the checks read would pass, the GitHub detail read now adds the checks the base branch requires but that have not reported, as pending: those of its rulesets come with the GraphQL detail, those of its branch protection from REST, which any reader may see (GraphQL shows them to admins alone). Core owns the gate both use.
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
Cut wasted runner time while keeping every platform, check and assertion. Final head
d54e1ae9passed all checks in 9m51s with zero LEAK on every runner, Windows included at eight test slots. The ~5-minute target is not met; see Merge Danger.The Windows leaks were Tcode's: a Windows child inherits every inheritable handle of its parent, so a
gitthat outlived a test process held nextest's output pipes open. Both process helpers now take Tcode's own standard handles out of that set once;Stdio::inheritstill hands them over through std's inheritable duplicates.services::process::command / agent's process::command + agent::keep_own_stdio_from_children() # Windows: clear HANDLE_FLAG_INHERIT on stdin/stdout/stderr, once CREATE_NO_WINDOW, PATHEXT resolutionThe runtime test host no longer guesses how long background work takes:
One repository lookup reads the remotes once, through the one trait method that takes it:
A branch checked out at the root reuses the root's listing;
branch_headandread_statusread theirs once; GitHub maps remotes through the shared parser.Evidence
Before: head
f06d3ab5, run 40013348040, 10m03s. A Windows-only failure (runs 40003709717, 40006676143) failed the requiredLinux x64check and cancelledWindows x64andmacOS arm64. Eight Windows slots produced 29 and 28 LEAKs in a same-binary comparison.After: head
d54e1ae9, run 40039230438, attempt 1, 9m51s, every job passed:Local, macOS, through mbx:
cargo fmt --all --check,cargo clippy --workspace --all-targets --locked -- -D warnings, actionlint: clean.cargo nextest run --workspace --lockedwith LEAK failing: 1269 passed, 13 skipped.tcode-runtimeat 30 slots on 15 CPUs, with 15 busy loops saturating the CPU: 20 of 20 stress iterations passed.keep_own_stdio_from_childrentype-checks and passes Clippy forx86_64-pc-windows-msvc; Windows CI ran it.Tests that relied on the quiet window, found by running the runtime suite with no window under load. Each now waits for the state it asserts; a state never reached fails after five seconds, and no assertion was loosened:
sweephelper: a sweep that finds a sync running is skipped, so it lets that sync finish first (an_ended_rebase_is_kept_for_every_device_until_the_next_full_sync_and_blocks_no_writefailed every loaded run).a_finished_child_holds_its_lead_until_settled_and_cancel_never_delivers: waits for the Cancel reply.pages_and_outputs_of_a_thread_nobody_opened_are_read_and_not_kept,an_appended_snapshot_drops_the_superseded_ones_diffs_in_the_same_commit: the bounded read answers before the whole-log read finishes; they wait for that read, then assert nothing or the whole log is kept.instructions_reach_the_provider_at_launch_and_no_turn_carries_them,a_wake_steers_into_a_running_turn_and_is_not_repeated, the watch harness'saccept: wait for the host to take the provider's events.Merge Danger
Door: two-way
Blast Radius: CI, the runtime test host, repository discovery
interrupt_pauses_an_idle_watch_and_resume_catches_up_once_after_restart("expected a delivered turn") in about 60 runtime-suite runs at roughly 7× CPU oversubscription; not reproduced in 30 targeted runs, at 2×, or in CI.