test(detach): ask the marker rule, not the machine the suite runs on - #14
Merged
whackur merged 1 commit intoAug 1, 2026
Merged
Conversation
`is_detached_child` read the environment and decided in one step, so the foreground case could only be tested by having no marker set — which is a fact about the machine. Running the suite from inside a nightcrow pane inherits `NIGHTCROW_DETACHED` from the daemon that spawned the pane, and the test then failed while saying nothing about the rule it names. Split the read from the rule, the way `child_args` and `background_command` are already split from spawning. Both answers are now stated outright, and the third case the rule quietly carries — that presence is what counts, so an empty value is still a marker and must not send the child off to detach again — is pinned rather than implied.
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.
cargo testfails ona_process_with_no_marker_is_the_foreground_copywhen the suite is run from inside a nightcrow pane. Not a flake and not
a Windows quirk: the pane's shell inherits
NIGHTCROW_DETACHEDfrom thedaemon that spawned it, and the test read that same variable through
is_detached_child().So the test asserted a fact about the machine it ran on rather than
about the rule it names. CI never saw it, because CI is not inside a
nightcrow pane — but anyone dogfooding the tool hits it on every run,
including through the
pre-pushgate.The change
is_detached_childread the environment and decided in one step. Thoseare now two steps, the way
child_argsandbackground_commandarealready split from spawning:
The tests pass the marker in. Both answers are stated outright instead
of one of them depending on ambient state, and a third case the rule
quietly carried is pinned: presence is what counts, so an empty value is
still a marker and must not send the child off to detach again.
Verification
Full suite green with
NIGHTCROW_DETACHED=1still set in the shell —1419 passed, 0 failed — which is the case that used to fail.
clippy -D warningsandfmt --checkpass; thepre-pushgate now runs clean frominside a pane without clearing the variable first.