Skip to content

test: retry recursive teardown removals — kill a class of phantom failures#549

Open
leeovery wants to merge 1 commit into
prose-tests/bugfix-corpusfrom
fix/test-teardown-rmsync-retries
Open

test: retry recursive teardown removals — kill a class of phantom failures#549
leeovery wants to merge 1 commit into
prose-tests/bugfix-corpusfrom
fix/test-teardown-rmsync-retries

Conversation

@leeovery

Copy link
Copy Markdown
Owner

Summary

  • A full-gate run went red on ENOTEMPTY inside an afterEach rmSync, in a suite unrelated to the change being made, while four background agents were churning temp directories. The same suite passed 3/3 in isolation.
  • Cause: the engine spawns git subprocesses; git drops lock/temp files a moment after the command returns, so a recursive remove that has just emptied a directory then fails to remove the directory itself. Pure timing — it only shows up under parallel load.
  • Every recursive teardown removal in tests/scripts now passes maxRetries: 5, retryDelay: 100, which is what the prose-test world builder already used for exactly this reason. 64 call sites across 25 suites, mechanical, no behavioural change.

Test plan

  • npm test green: 1699 tests, 0 fail.
  • The originally-failing suite re-run 3× in isolation before the change: clean each time, confirming a race rather than a logic fault.

🤖 Generated with Claude Code

…lures

A full-gate run went red on ENOTEMPTY inside an afterEach rmSync, in a
suite unrelated to what was being changed, while four background agents
churned temp directories. It passed 3/3 in isolation: the engine spawns
git subprocesses, git drops lock and temp files a moment after the
command returns, and a recursive remove that has just emptied a
directory then fails to remove it.

Every recursive teardown removal in tests/scripts now passes
maxRetries/retryDelay, as the prose-test world builder already did. 64
call sites across 25 suites; no behavioural change, and a false red on
the gate costs more than the churn.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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