Repository navigation
Conversation
inkless
force-pushed
the
gz/bz-409-flake-install-running-builds-test-on-macos
branch
from
November 22, 2026 23:13
8fe49d7 to
3f90336
Compare
…hen testing running builds
are_read_from_the_kernel_which_lists_this_process asked the real running_builds for a fresh,
empty directory and expected Some({}). That answer depends on every process the runner's user
has: running_builds rightly gives up when any of them reads back with an owner or arguments that
can't be read, and on a shared macOS runner nextest's own test processes start and exit around
it. It failed once that way, left: None.
The test now hands running_builds_with the kernel's real list, kept to this process, and the
real reader. It still fails if the list can't be read, doesn't show this process, or the reader
misreads its owner or arguments. Production is unchanged.
Control: install::tests::are_read_from_the_kernel_which_lists_this_process: listed_me |= false in running_builds_with -> left: None, right: Some({})
Control: install::tests::are_read_from_the_kernel_which_lists_this_process: seen_by answering argv: None for a readable process -> left: None, right: Some({})
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
inkless
force-pushed
the
gz/bz-409-flake-install-running-builds-test-on-macos
branch
from
November 22, 2026 23:26
3f90336 to
11a6f3a
Compare
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.
What
install::tests::are_read_from_the_kernel_which_lists_this_processfailed once onrust (macos)withleft: None, right: Some({}). It called the realrunning_buildsover a fresh, empty holder directory, so its answer depended on every process the runner's user had, not only on what the test sets up.The test now hands
running_builds_withthe kernel's real list (process::pids()) kept to this process's pid, with the real reader (seen). It still fails if the list can't be read, doesn't show this process, or the reader misreads this process's owner or arguments. It reads no other process, and it spawns and signals nothing, so it stays a host test. Test-only change; no production code moves.Why
Noneis right, and production stays as it isrunning_buildsreturnsNonewhen any listed process of this user reads back with an owner (Seen::Unknown) or arguments (Seen::Of { argv: None }) that can't be read.Nonemakesprune_unused_withremove nothing. Its only caller is the daemon's start (installincrates/bazhen-daemon/src/holder.rs).A process of this user whose arguments can't be read might be a holder running an old build. The module's invariant is that a build goes only once no process of this user runs it. Skipping such a process could delete a live holder's build. Giving up costs only that old builds wait for the next daemon start. A retry would narrow the race, not remove it. So fail-closed is deliberate. It is pinned by
install::tests::are_unknown_when_a_process_of_this_user_s_arguments_can_t_be_read_and_then_none_go(and, for an unreadable owner,takes_a_process_for_gone_or_another_s_only_when_the_kernel_says_so_and_else_knows_nothing). Please don't "fix" this by havingrunning_buildsskip unreadable processes.What made it
Noneon the runner: not confirmedThe CI log doesn't say which process read back unreadable, so this part is unconfirmed:
proc_pidinfo(PROC_PIDT_SHORTBSDINFO), which answersESRCHfor a zombie, andseen_bymapsESRCHtoSeen::Gone.proc_pidinfostill answers butKERN_PROCARGS2fails, andstart_time::ofdoesn't yet say it's absent.KERN_PROC_ALLgrowing past its four tries would also giveNone.The fix doesn't depend on which of these it was: each lies outside what the test controls.
Verification
moon run :test-rust -- install::tests: 25 passed.left: None, right: Some({}), then restored (recorded asControl:trailers on the commit):listed_me |= falseinrunning_builds_withseen_byansweringargv: Nonefor a readable processmoon run :check: CHECK_EXIT=0.Self-review tier: none. This is a small, test-only change in one function; an independent review follows.
🤖 Generated with Claude Code