Skip to content

test(workroomd): the downgrade test waits out a busy script and says what it got - #602

Merged
joelmoss merged 1 commit into
masterfrom
fix/601-handoff-test-etxtbsy
Nov 8, 2026
Merged

joelmoss merged 1 commit into
masterfrom
fix/601-handoff-test-etxtbsy

Conversation

@joelmoss

@joelmoss joelmoss commented Nov 8, 2026

Copy link
Copy Markdown
Owner

🤖 Opened by Claude Code.

Summary

daemon::handoff::tests::a_hand_off_to_an_older_build_is_refused failed on CI (run 42504079128, #597) at a bare assert!(… .contains("older than this daemon's build 200")), which didn't say what error it got instead.

The test writes small shell scripts and runs them straight away. On Linux, a script can still be open for writing in a child that another test thread has forked but not yet exec'd. Running it in that window fails with ETXTBSY ("Text file busy"), so the probe returns a start error, not the refusal the test expects.

 a_hand_off_to_an_older_build_is_refused
-  BuildProbe::start(binary)?…           # one try; ETXTBSY surfaces as a mismatched error
-  assert!(err.to_string().contains(…))  # silent about what came instead
+  start_probe(binary)?…                 # retries a start Linux reports busy, 10 ms apart, up to 1 s
+  assert_refused(result, "…")           # panics with the error it actually got
+a_script_still_open_for_writing_is_waited_for_not_refused   (Linux only)
+  holds the script open for writing: plain start → ETXTBSY; start_probe → succeeds once it closes

Test code only; the daemon's own hand-off is unchanged.

Evidence

  • New test on Linux (rust:1.96.1-bookworm in Docker): it passes, which shows both halves:
    • running a script that's open for writing fails with ETXTBSY;
    • start_probe waits for the file to close, then succeeds.
  • Could not reproduce CI's failure: master's version of the test passed 15 full workroomd --lib runs on Linux and 20 single-test runs on macOS. So ETXTBSY is the likely cause rather than a confirmed one. If it ever fails again, assert_refused now names the real error.
  • Gates:
    • make vcs-lint (Rust 1.96.1): clean.
    • make vcs-test VCS_TEST_FLAGS="-p workroomd --lib": 330 passed without terminal-state, and 425 passed, 2 ignored with it.
    • The new test is Linux-only, so it runs in CI's rust jobs, not on macOS.

Merge Danger

Door: two-way. Blast Radius: none outside this test.

Fixes #601

🤖 Generated with Claude Code

https://claude.ai/code/session_01QxGw2gUmeT3FCNK7RnCdky

…what it got (#601)

a_hand_off_to_an_older_build_is_refused writes small scripts and runs them at
once. On Linux a script can still be open for writing in a child another test
thread forked and hasn't exec'd, and running it then fails with ETXTBSY; the
probe's error didn't match the expected refusal and the bare assert said
nothing. start_probe retries a start Linux reports busy (10 ms, up to 1 s), and
assert_refused prints the error it got. A Linux-only test holds a script open
for writing to show the plain start fails with ETXTBSY and start_probe
succeeds once it is closed.

Fixes #601

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QxGw2gUmeT3FCNK7RnCdky
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-08T18:03:02.908426Z 54b264b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@joelmoss
joelmoss merged commit b500a84 into master Nov 8, 2026
11 checks passed
@joelmoss
joelmoss deleted the fix/601-handoff-test-etxtbsy branch November 8, 2026 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky: workroomd a_hand_off_to_an_older_build_is_refused fails on CI

1 participant