Repository navigation
Description
This was generated by AI during triage.
What happened
- In CI on Refresh site pages and help for shipped features #1098 (run 39865732335, first attempt,
testjob),unresolved_console_address_stops_proxy_installation_before_any_changesfailed intests/console_install.rswhile reading itslookupfile:NotFound("No such file or directory"). Its earlier assertions passed: the install script stopped with the expected "has no DNS record" message and changed nothing. Refresh site pages and help for shipped features #1098 changes only site pages, the help text and acommand_surfacetest. - On the
thirdshifthost, Bring thirdshift.app's homepage, How it works and Architecture pages up to date with shipped features #1095's CI-fix Repair reproduced a sibling failure on the third concurrent repetition ofcargo test --test console_install.unit_preserves_literal_paths_with_shell_and_systemd_metacharacterspanicked attests/console_install.rs:404withOs { code: 26, kind: ExecutableFileBusy, message: "Text file busy" }.
Cause
tests/console_install.rs writes executables in the test process and then runs them:
Machine::toolwrites each fake tool, such assystemctl,caddy,getentandcertbot, withfs::writeand thenset_permissions.unit_preserves_literal_paths_with_shell_and_systemd_metacharacterscopies the thirdshift binary withfs::copy.
cargo test runs the file's 15 tests on parallel threads. A child that another test spawns while one of those files is open for writing inherits the descriptor, and running the file then fails with ETXTBSY until that child execs or exits.
The install script runs getent hosts '<host>' >/dev/null 2>&1, so a fake getent that can't run looks the same as an address that doesn't resolve. The script prints the expected message, and the only symptom is the missing lookup file that the fake would have written.
The rest of the suite already guards against this, each with a comment saying why:
write_executableinsrc/test_support.rswrites the file through a child process:sh -c 'cat > "$1" && chmod 755 "$1"'.tests/console.rsandtests/support/mod.rscopy the binary withcp.
The same pattern elsewhere
About 18 other places write an executable with fs::write and set_permissions in the test process, in:
src/session/execution_tests.rssrc/worktree/acquisition_tests.rs,preservation_tests.rsandreview_recovery_tests.rstests/console.rsandtests/console/cronjobs.rstests/pickup_run.rs,tests/process_tree.rsandtests/release.rs
They haven't been seen failing yet, but they are open to the same race.
Cost
Each flake fails CI on an unrelated pull request. The Run delivering it then spends a CI-fix Repair (#1095's ran for more than 30 minutes) and a Check re-run before it can merge.
Activity
JacobStephens2 commentedon Oct 22, 2026
Agent Brief
Category: bug
Summary: Write every test executable from a child process, so no test runs a file its own process may still hold open for writing.
Current behavior:
Tests write fake tools, shims, hooks and copies of the thirdshift binary in the test process, with
fs::writeandset_permissionsor withfs::copy, and then run them.cargo testruns a test binary's tests on parallel threads. A child spawned by another test can inherit the open write descriptor, and running the file then fails with ETXTBSY ("Text file busy"). This failed CI on #1098, and #1095's Repair reproducedExecutableFileBusyin the console install tests (details in the issue body, which lists every place with the pattern).Desired behavior:
PATHor as a git hook, writes it from a child process. That's what the binary's test-supportwrite_executablealready does, withsh -c 'cat > "$1" && chmod 755 "$1"'.write_executable.Machine::tool, though that file doesn't use the shared test support today.cpin a child process rather than byfs::copy, as the Console tests already do.sh <file>, and files that are never executed keep their current writes.Key interfaces:
write_executable(path, contents)in the binary's test support keeps its contract and is reused by unit tests.Machine::toolwrites through that helper.Acceptance criteria:
set_permissionswith an executable mode, and forfs::copyofCARGO_BIN_EXE_thirdshift, finds only the helpers or files that are never executed.cargo test --test console_installmany times, several runs at once, reproduces "Text file busy" (Bring thirdshift.app's homepage, How it works and Architecture pages up to date with shipped features #1095's Repair saw it on its third repetition). After it, 50 such repetitions all pass.cargo test,cargo clippy --all-targets -- -D warningsandcargo fmt --checkpass.Out of scope:
getentthat can't run. Treating it as an unresolved address is a separate question for real installs.cargo testto nextest. CI keeps plaincargo teston purpose, so the suite runs the way a contributor runs it.