Skip to content

test(infra): retry recursive temp-dir removal on main (main twin of #11968) - #12246

Merged
diegosouzapw merged 2 commits into
mainfrom
fix/main-rm-maxretries
Sep 1, 2026
Merged

test(infra): retry recursive temp-dir removal on main (main twin of #11968)#12246
diegosouzapw merged 2 commits into
mainfrom
fix/main-rm-maxretries

Conversation

@diegosouzapw

Copy link
Copy Markdown
Owner

What

main has been red since b342c1a361 on two of the five gates reported by #12133:

✖ Vitest — tests/unit/autoCombo/provider-family-combos.test.ts > auto/<family>
✖ Integration — chat pipeline applies Codex OAuth fingerprint and priority tier inside combos

Both tests call resetStorage() from beforeEach, which runs fs.rmSync(TEST_DATA_DIR, { recursive: true, force: true }) with no retry, and intermittently loses the race against a not-yet-released SQLite handle (ENOTEMPTY).

release/v3.8.51 already fixed this in #11968 with a mechanical codemod adding maxRetries: 5, retryDelay: 100 to every recursive rm/rmSync/rmdirSync under tests/. That PR landed only on the release branch — and since main only receives work at the release squash, it stayed broken for the entire cycle. Repo-wide gates then turn every open PR into main red on a check unrelated to its diff (see _shared/merge-gates.md §8).

How

This is the --base main twin: re-runs the very same codemod that already shipped on the release branch (scripts/ad-hoc/codemod-rm-maxretries.mjs, kept in the repo for exactly this), so both branches converge on identical test-teardown semantics.

Test-only — no product logic touched. Audited the diff: every added line is maxRetries / retryDelay, and every removed line is the same call without them.

Validation

Ran the two gates that are actually red on main, from this branch:

Test Result
tests/unit/autoCombo/provider-family-combos.test.ts (--config vitest.mcp.config.ts) 11/11 pass
tests/integration/chat-pipeline.test.ts 28/28 pass

npm run typecheck:core clean.

What this does NOT fix

The other three failures on #12133 are runner-contention timeouts, not code defects, and have no fix to port:

  • Unit tests (full suite) — killed at its 4800s ceiling
  • Package artifact (npm pack policy) — killed at its 1200s ceiling
  • Tarball boot-smoke — skipped because package-artifact produced no dist/

validate-release-green.mjs runs those heavy gates concurrently on a single shared hosted runner (the script itself notes a 2-3× contention factor, #9532). Expect #12133 to keep reporting those three after this merges — that is chronic infra, not a regression.

Refs #12133

…11968)

`main` has been red since b342c1a on the vitest and integration gates:

  ✖ tests/unit/autoCombo/provider-family-combos.test.ts > auto/<family>
  ✖ chat pipeline applies Codex OAuth fingerprint and priority tier inside combos

Both call resetStorage() from beforeEach, which does an fs.rmSync(TEST_DATA_DIR,
{recursive: true, force: true}) with no retry, and intermittently loses the race
with a not-yet-released SQLite handle (ENOTEMPTY).

release/v3.8.51 fixed this in #11968 with a mechanical codemod adding
maxRetries/retryDelay to every recursive rm/rmSync/rmdirSync under tests/, but
that PR landed only on the release branch. Because main only receives work at
the release squash, it stayed broken for the whole cycle — and repo-wide gates
then turn every open PR into main red on checks unrelated to their diff.

This is the --base main twin: re-runs the same codemod that already shipped on
the release branch (scripts/ad-hoc/codemod-rm-maxretries.mjs), so the two
branches converge on identical test-teardown semantics. Test-only; no product
logic is touched.

The remaining three failures reported on #12133 (unit full suite exceeding its
4800s ceiling, package-artifact exceeding 1200s, and the boot-smoke that is
skipped as a consequence) are runner-contention timeouts, not code defects —
validate-release-green.mjs runs those heavy gates concurrently on one shared
hosted runner. There is no fix to port for those.
…ts output

The codemod that generated the previous commit lives in the repo on
release/v3.8.51 (added by #11968) but was never on main. Bringing it over keeps
the tool next to the change it produced, so the transformation stays
reproducible and auditable from either branch.
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

CI Coverage Report

  • Coverage job: success
  • PR test policy: success

Coverage artifact was not available for this run.

@diegosouzapw
diegosouzapw merged commit 93265ee into main Sep 1, 2026
49 checks passed
Mafsolin added a commit to Mafsolin/OmniRoute that referenced this pull request Sep 3, 2026
Brings in the measured-RSS build memory guards (OMNIROUTE_BUILD_WORKERS 3->2,
diegosouzapw#7518/diegosouzapw#11719) that fix the OOM-killed vps-sh build, the recursive temp-dir
removal retries (diegosouzapw#12246), and the release/CI fixes.

Conflicts: 68 test files were formatting-only duplicates of the maxRetries
codemod our fork already carried (kept ours). Kept our retired-provider test
deletions (diegosouzapw#11708/diegosouzapw#11713), our layer-cached Dockerfile.bun, and our fork-only
tests; took upstream's parameterized docker-build-memory-budget test and
bundler-flag change. Re-applied the maxRetries guard to the 7 rmSync sites in
chatgpt-web-codex.test.ts that --ours would have left unguarded.
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