Skip to content

tests: scripts a test runs are written by sh, not by the test process - #98

Merged
blockmandev merged 1 commit into
mainfrom
fix/agy-test-text-file-busy
Nov 15, 2026
Merged

blockmandev merged 1 commit into
mainfrom
fix/agy-test-text-file-busy

Conversation

@blockmandev

Copy link
Copy Markdown
Member

tests: scripts a test runs are written by sh, not by the test process

agent::agy::tests::a_whole_turn_reports_these_events_and_this_outcome
failed once on ubuntu-latest (PR 97, run 43751808555) with no events at
all, and passed on a rerun of the same commit. The test asserted the
events before the turn's result, so the log could not say why the turn
produced nothing.

Two changes:

  • That test's event assertion now prints how the turn ended, so a turn
    that never started says why.
  • The probable cause is removed everywhere it can happen. A test binary
    runs its tests on many threads; a program another thread starts while
    this process holds a script open for writing is handed that open file
    until it has started, and running the script in that moment fails with
    ETXTBSY ("Text file busy"). This is inferred, not shown by the log: it
    fits a turn that fails before its first event. The new
    crate::test_support::write_script (tests only, off Windows) has a
    short-lived sh write the file and chmod it, so the test process never
    opens it. All 13 test sites that wrote a script and then ran it use it:
    agy_tests, agy/bridged_tests, claude_code/tests (6), codex/tests,
    hooks/engine (2), toolbox/reading_tests and verify. self_update.rs is
    production code and is unchanged.

The Unix-only sites do not compile on Windows; CI's Linux and macOS jobs
are their compile and test check (a local musl cross-check could not
build openssl-sys).

agent::agy::tests::a_whole_turn_reports_these_events_and_this_outcome
failed once on ubuntu-latest (PR 97, run 43751808555) with no events at
all, and passed on a rerun of the same commit. The test asserted the
events before the turn's result, so the log could not say why the turn
produced nothing.

Two changes:

- That test's event assertion now prints how the turn ended, so a turn
  that never started says why.
- The probable cause is removed everywhere it can happen. A test binary
  runs its tests on many threads; a program another thread starts while
  this process holds a script open for writing is handed that open file
  until it has started, and running the script in that moment fails with
  ETXTBSY ("Text file busy"). This is inferred, not shown by the log: it
  fits a turn that fails before its first event. The new
  crate::test_support::write_script (tests only, off Windows) has a
  short-lived sh write the file and chmod it, so the test process never
  opens it. All 13 test sites that wrote a script and then ran it use it:
  agy_tests, agy/bridged_tests, claude_code/tests (6), codex/tests,
  hooks/engine (2), toolbox/reading_tests and verify. self_update.rs is
  production code and is unchanged.

The Unix-only sites do not compile on Windows; CI's Linux and macOS jobs
are their compile and test check (a local musl cross-check could not
build openssl-sys).
@blockmandev
blockmandev merged commit 76302d9 into main Nov 15, 2026
12 checks passed
@blockmandev
blockmandev deleted the fix/agy-test-text-file-busy branch November 15, 2026 20:29
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.

1 participant