Repository navigation
test: rmrf exponential backoff + sweep remaining bare recursive rmSync (#1646 follow-up, #1910) - #1915
Conversation
…e rmSync (#1646 follow-up, #1910) The ubuntu-22 release-gate leg of #1910 hit the #1646 ENOTEMPTY teardown race again: side-request-isolation #1129's finally-block rmrf exhausted the flat 10x50ms retry budget while a late debounced session flush (5ms debounce recreating <tmp>/<provider>/) kept the tree alive past every retry under full-suite load. All of the test's assertions had already passed — the gate was killed by its own cleanup. - tmp-rm.ts: escalate to a bounded exponential-backoff loop (25->1600ms, ~3.2s total, only paid on an actual race) around the same transient-error set Node's rimraf retries (ENOTEMPTY/EBUSY/EPERM/EACCES/EMFILE). Sync sleep via Atomics.wait — legal on any thread, and teardown wants the loop blocked, not interleaved. - tests/tmp-rm.test.ts: pin the contract — rmrf must outlive a writer that recreates the tree every 10ms for ~250ms, force swallows ENOENT, non-transient errors still throw. - sweep the 36 leftover bare rmSync(..., { recursive: true, force: true }) calls across 11 suites onto rmrf; codex-overlay-env's local rmrf wrapper is replaced by the shared import. Local: tmp-rm 3/3, launcher+fix-decompress-tofile 261/261, side-request- isolation green, the other swept suites green; dsh-settings-ui (5) and dsh-native fail identically on clean master locally (stale dist — CI legs green); typecheck clean. Refs #1646, #1194 (same signature on an earlier release gate).
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.1906-pr.1915.7d7f1f3This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr1915.tgz
npm install -g packageInstall instructions are refreshed on each push. |
…s cannot interleave with sync rmSync (#1915 review follow-up) The race test's setInterval writer runs on the same event loop as the synchronous rmSync, so it can never recreate entries between readdir and rmdir: the backoff loop was never exercised (the test body passes against a bare one-shot rmSync too). Drive the loop through a _setRmImplForTest seam instead — default impl unchanged — and pin recovery after transient failures, budget exhaustion (8 attempts, full ~3.2s ladder), and immediate throw on non-transient errors. Relabel the in-process writer case as the smoke pass it is. Also fix the stale header note: the retry lives in rmrf's own loop now, not in rmSync options.
[bot] 🏷 Review complete — one finding, fixed directly on the branch (commit 方向关(审原 issue):问题真实存在且定位正确——#1910 的 ubuntu-22 release-gate 腿再次命中 #1646/#1194 同签名的 teardown 竞态,根因是 flat 10×50ms(~500ms)预算在 full-suite 负载下扛不过有界的 writer burst(5ms debounce 的延迟 session flush)。修法打在机制上(teardown 预算本身),不是症状。Sweep 完整性已验证:PR head 上 测试有效性关(发现并已修):原
结构化七问
CI 状态:首查时全部 e2e 腿(real codex/dsh/pi/opencode、codex overlay、build-artifact、version-guard、hermetic registry)已绿;新 commit 重新触发的单测腿(含出事的 ubuntu-22)运行中。dsh-settings-ui 本地 5 败的声明(clean master 同样失败、stale dist)接受待其 CI 腿确认。 判定:代码可合——等 |
[bot] 🏷 CI 全绿,收工判定更新:
判定:可合并。 PR 现含两个 commit——原 backoff+sweep、review 补的测试 seam 与确定性 loop-pin。合并动作留给人工:#1915 |
…EBUSY/EPERM teardown) Every SessionStore created under BILI_STORAGE_UNIFIED holds the index.db SQLite handle until GC; cancelAll() never closes the shadow, and Windows cannot unlink an open file — the engproof teardown then pins the temp dir in EBUSY (index.db) / EPERM (dir) on every run of the new fcac9e3 suite (#1915 rmrf family; POSIX unlinks open files, hence linux-green). Switch the last lifecycle call of each store to closeQuietly(); the corrupt-index test closes only after its final writeNow (write-after-close would test a different thing). Unblocks #2764 / #2774 windows legs.
… flake, #1646/#3720 family) Incidental CI-red fix for #3930: the test(windows-latest, node 22, shard 1) lane of the rebased head failed in tests/issue3399-cross-route-load.test.ts teardown with ENOTEMPTY on the bare recursive rmSync - a leftover holdout from the tmp-rm sweep (#1646/#1915/#3721). Unrelated to the bootstrap regression test added by this PR, which passed on the same lane.
… flake, #1646/#3720 family) Incidental CI-red fix for #3930: the test(windows-latest, node 22, shard 1) lane of the rebased head failed in tests/issue3399-cross-route-load.test.ts teardown with ENOTEMPTY on the bare recursive rmSync - a leftover holdout from the tmp-rm sweep (#1646/#1915/#3721). Unrelated to the bootstrap regression test added by this PR, which passed on the same lane.
… flake, #1646/#3720 family) Incidental CI-red fix for #3930: the test(windows-latest, node 22, shard 1) lane of the rebased head failed in tests/issue3399-cross-route-load.test.ts teardown with ENOTEMPTY on the bare recursive rmSync - a leftover holdout from the tmp-rm sweep (#1646/#1915/#3721). Unrelated to the bootstrap regression test added by this PR, which passed on the same lane.
What
The ubuntu-22 release-gate leg of #1910 hit the #1646 ENOTEMPTY teardown race again:
side-request-isolation#1129's finally-blockrmrfexhausted the flat 10×50ms retry budget while a late debounced session flush (5ms debounce recreating<tmp>/<provider>/) kept the tree alive past every retry under full-suite load. All of the test's assertions had already passed — the gate was killed by its own cleanup, same signature as #1194 and #1646.Changes
tests/tmp-rm.ts— escalate to a bounded exponential-backoff loop (25→1600ms, ~3.2s total, paid only when a race actually happens) around the same transient-error set Node's rimraf retries (ENOTEMPTY/EBUSY/EPERM/EACCES/EMFILE). Sync sleep viaAtomics.wait— legal on any thread; teardown wants the loop blocked, not interleaved.tests/tmp-rm.test.ts(new) — pins the contract: rmrf outlives a writer recreating the tree every 10ms for ~250ms (past the old 500ms budget under runner drift),forceswallows ENOENT, non-transient errors still throw.rmSync(..., { recursive: true, force: true })calls across 11 suites (port-zone, launcher, dsh-native, dsh-settings-ui, fix-decompress-tofile, compat-drop, log-mask, named-provider-bind, responses-seam-probes, responses-plugin-dev-position, codex-overlay-env) ontormrf; codex-overlay-env's local rmrf wrapper replaced by the shared import.Verification
tests/tmp-rm.test.ts3/3; launcher + fix-decompress-tofile 261/261; side-request-isolation green; remaining swept suites green (96/101 aggregate — the 5 fails are dsh-settings-ui, which fails identically on clean master locally, stale dist; its CI leg is green)npm run typecheckcleansrc/changes — tests onlyCloses nothing directly; unblocks release-gate reruns for the #1646/#1194/#1910 family.