Skip to content

fix(test): the H4 fixture teardown waits for exit + retries the rmSync (#830) - #831

Merged
aarontrowbridge merged 2 commits into
mainfrom
fix-modeblock-teardown
Sep 5, 2026
Merged

fix(test): the H4 fixture teardown waits for exit + retries the rmSync (#830)#831
aarontrowbridge merged 2 commits into
mainfrom
fix-modeblock-teardown

Conversation

@aarontrowbridge

Copy link
Copy Markdown
Member

Closes #830.

The session-API availability fixture's teardown was fire-and-forget: SIGTERM + an unref'd SIGKILL timer, then an IMMEDIATE recursive rmdir of the temp HOME — while the vendored binary's background package-install was still writing into it. ENOTEMPTY on CI, reproduced twice on the same run (zod/src/v3/tests, then effect/dist/unstable — the nondeterminism of a write-race), never on a warm director-local run. It blocked every open PR's fast check (seen blocking #828).

Fix, both halves of the race: (a) killAndWait() — SEQUENTIAL shutdown awaited to process exit (SIGTERM → 10s bounded wait → SIGKILL → 5s bounded wait; the exit/error listeners are cleaned on timeout); (b) a RETRYING rmSync (maxRetries 20 × retryDelay 250ms — Node natively retries ENOTEMPTY/EBUSY) bounding any residual grandchild writer.

Honesty note on the RED: a cross-process write-race has no deterministic RED — the reviewer's own note on the #814 review said exactly this of the lock-release race. The verification is the fixture passing locally (director-run) and the CI fast job green across reruns; the race window that CI hit twice is now closed at the root (no write can be in flight after a child-exit await) and bounded at the surface (retried removal).

Verification: mode_block suite (32 tests) green locally, full extension suite green, smoke PASS — director-run, scrubbed env.

@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 4a7301ab-184d-47ad-a142-ca387108b5aa


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

H4 fixture teardown race: ENOTEMPTY rmdir of the temp HOME breaks fast CI (from #814)

1 participant