Repository navigation
fix(tests): extend tmp-rm EBUSY retry budget for c=4 Windows teardown load (#2908) - #2914
Conversation
… load (#2908) #2816's c=4 concurrent test scheduling raised per-runner load so a transient Windows AV/indexer lock on sessions/index.db can outlast the old ~3.2s rmrf window (win-latest leg of PR #2890: EBUSY unlink index.db). A probe confirmed the golden harness holds no self-handle at rmrf time (flushAllSessions closes the store's shadow first), so this re-sizes the external-lock budget rather than masking an in-process leak. Ladder 25..1600ms (~3.2s/8 attempts) -> 25..3200ms (~7.6s/10 attempts); only paid when a race actually happens.
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.3242-pr.2914.5e6c72fThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2914.tgz
npm install -g packageInstall instructions are refreshed on each push. |
…), not ~7.6s The #2908 disclosure under-stated the new budget: [25..1600,3200,3200] sums to 9575ms. Tighten the storm-case pin from >=7400 to >=9400 so a dropped rung (e.g. the 1600 step: 7975ms) can no longer slip through.
[bot] 🏷 Review 完成:方向正确、triage 独立复核成立;顺手修了一处披露算术错误(commit c3dafdb + PR 描述已同步更正)。等新 head 的 CI 四腿绿即可合并。 独立复核(triage 三步,审核姿态重走一遍)子缺陷 #1(driveWire finally 未关最终 store)—— 维持「已证伪」结论,代码路径逐行核过:
Review 中发现并已直接修掉的小问题(仅报告不是合法处置)新梯
回归审查(既有行为清点)diff 触碰的既有行为只有一项:teardown 重试预算(全仓 ~643 个
结构化八问
CI 与判定
|
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.323-master.18776d5 # this exact build
npm install -g billion-context@master # always the newest merged build
|
Closes #2908
What
win-latest leg of PR #2890 failed exactly one case —
EBUSY: resource busy or locked, unlink '…\golden-chat-*\sessions\index.db'during golden-harness teardown (6468/6492 pass, 1 fail, 23 skip). ubuntu-22/24 + win24 were all green (including the anthropic/responses/google wire variants of the same harness), andrerun-failed-jobsmade the whole run pass → non-deterministic, runner-load related. Same failure domain as the closed #2799 (fixed by #2808), with a residual window.Triage (reproduce → layer → verdict)
driveWireacross every storage combo (full+reload keepFile/dropFile,full/shadowno-reload,legacy) and countsUnifiedStore.open/close: no self-handle leak — every openedindex.dbhandle is closed beforedriveWirereturns.flushAllSessions()attests/golden-storage-drive.ts:497closes the registered store's shadow before thefinally/rmrfruns. So the issue's sub-defect fix: keep system prompt byte-stable for prefix cache #1 ("finally never closes the final surviving store") is refuted; addingstore?.closeQuietly()in the finally would be a no-op.index.db, so the blockingAtomics.waitbackoff guarantees the budget is exhausted) also does not apply toindex.db— no same-process writer holds it at rmrf time. Convertingrmrfsync→async would additionally ripple through ~150 test files / 643 call sites (clean-diff gate).index.dboutlasted the old ~3.2s retry window. That is the exact class the repo already documents for Windows sessions-dir files ([bug] 0.1.63 起 Windows persist EPERM 风暴:会话持久化静默丢数据(4.9k 次/117 会话)+ compress no-valid-ranges 拒绝 #362 AV exclusion, test: teardown rmSync ENOTEMPTY race — most test cleanups lack retry options (CI ubuntu-latest Node 22 flake) #1646 ENOTEMPTY on loaded runners, release v0.1.180 #1910 budget escalation).Fix
Right-size the external-lock budget rather than mask anything: extend the
RETRY_DELAYS_MSladder intests/tmp-rm.ts. It is only paid when a race actually happens — zero effect on the happy path.Behavior change (old → new)
[25,50,100,200,400,800,1600](~3.2s total, 8 attempts) →[25,50,100,200,400,800,1600,3200,3200](~9.6s total, 10 attempts). Reason: c=4 load pushed transient-lock duration past the pre-c=4 budget (this ladder was last tuned at ~3.2s by release v0.1.180 #1910). Worst case adds ~6.4s to a single teardown, and only when it actually hits a lock race (rare).tests/tmp-rm.test.ts: storm case now expects 10 calls and ≥9400ms (was 8 / ≥3100ms).Not taken (and why)
closeQuietly()in finally): no-op — the probe proves the handle is already closed.index.db, and the 643-caller blast radius makes it disproportionate for a CI-flake fix.Verification
node --import tsx --test tests/tmp-rm.test.ts→ 6/6 pass (storm case paid the full ~9.6s ladder);tests/storage-engine-proofs.test.ts→ 12/12 pass including the four wire-parity tests that drivedriveWire→rmrf. Linux cannot reproduce the Windows EBUSY, so local green = no-regression only.Scope
Single module (
tests/tmp-rm.ts+ its test). No wire / config / config-surface / kernel / persistence change. Pure test-infra hardening.