Skip to content

test(node): write the fake runsc from a child, so its exec cannot fail - #425

Merged
WaylandYang merged 1 commit into
devfrom
claude/fake-runsc-etxtbsy
Oct 31, 2026
Merged

WaylandYang merged 1 commit into
devfrom
claude/fake-runsc-etxtbsy

Conversation

@WaylandYang

@WaylandYang WaylandYang commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Fixes the ci / rust failure on dev (f2300a0), which also failed rust on #423.

a_restore_that_fails_removes_the_container saw delete where it expected restore delete , so the fake runsc never ran. The test wrote the script from the test process. Another test forking at that moment keeps the write descriptor until it execs, and running the script then fails with ETXTBSY. The test added in #411 has this race, and any runsc test can hit it. Product code is unaffected.

The script is now written by a child process, so the test process never holds a write descriptor for it.

Tested on Linux (2 vCPU):

  • A standalone program in the same shape, 8 threads, 32,000 execs: 176 ETXTBSY before, 0 after.
  • node::backend::tests, 8 threads, 40 rounds: all passed.
  • The whole lib, 8 threads, 12 rounds: this test never failed.

Not fixed here: on that 2 vCPU machine the whole lib still fails, in tests this change does not touch. node::wake::tests::a_wake_waits_for_a_tier_change_in_progress failed every round ("4 wakes already waiting to restore, at most 4"), and node::gateway tests failed in some rounds at 8 threads.

🤖 Generated with Claude Code

a_restore_that_fails_removes_the_container failed on dev and on a PR, with
calls "delete " where "restore delete " was expected: runsc never ran. The
test wrote the script from this process, and a test forking on another
thread keeps the write descriptor until it execs, so exec of the script
failed with ETXTBSY. In the same shape on Linux, 176 of 32,000 execs failed.
With a child writing the script, none did.

The real runsc is not written by the process that runs it, so this is the
test's own race.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@WaylandYang
WaylandYang merged commit ef7f84d into dev Oct 31, 2026
5 checks passed
@WaylandYang
WaylandYang deleted the claude/fake-runsc-etxtbsy branch October 31, 2026 09:09
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