Repository navigation
test(wsl): account for the route quarantine in stalled-mount tests - #15408
Conversation
#15381 added a route-level quarantine: a timed-out task blocks new admissions on that route for a back-off window, so the next real task probes recovery instead of hammering a hung mount. It merged with four tests already failing on main, and they still fail. Two causes, both test-side: - The recovery half of three tests read again immediately after releasing the stall, which the quarantine now refuses. They wait out the window, which is what a real caller does — resetting the gate would skip the admission the recovery assertions exist to prove. - `blockedRoutes` is module state that no test cleared, so a stall in one test refused an unrelated read in the next. Both files now reset the gate in beforeEach. Production behavior is unchanged and is working as designed: eviction still happens, only the immediate re-read is deferred by the back-off.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughUpdated WSL stall-recovery tests for session indexes and transcripts. Tests now reset filesystem gate state before each test, fake 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
#15381 applied this same fix to session-scanner-core-parser-wsl-stall, session-scanner-discovery-wsl-gate, and opencode-usage/scanner-wsl-gate, and missed these two files. Adopt that established shape rather than a parallel one: fold the back-off wait into releaseAndSettle instead of a separate helper at each call site, and fake performance explicitly, since performance.now drives the quarantine clock. The explicit toFake is not strictly required today — vitest's default already fakes performance — but it documents the dependency and stops a default change from silently unfaking the quarantine clock.
…15408) * test(wsl): account for the route quarantine in stalled-mount tests #15381 added a route-level quarantine: a timed-out task blocks new admissions on that route for a back-off window, so the next real task probes recovery instead of hammering a hung mount. It merged with four tests already failing on main, and they still fail. Two causes, both test-side: - The recovery half of three tests read again immediately after releasing the stall, which the quarantine now refuses. They wait out the window, which is what a real caller does — resetting the gate would skip the admission the recovery assertions exist to prove. - `blockedRoutes` is module state that no test cleared, so a stall in one test refused an unrelated read in the next. Both files now reset the gate in beforeEach. Production behavior is unchanged and is working as designed: eviction still happens, only the immediate re-read is deferred by the back-off. * test(wsl): match the sibling suites' quarantine idiom #15381 applied this same fix to session-scanner-core-parser-wsl-stall, session-scanner-discovery-wsl-gate, and opencode-usage/scanner-wsl-gate, and missed these two files. Adopt that established shape rather than a parallel one: fold the back-off wait into releaseAndSettle instead of a separate helper at each call site, and fake performance explicitly, since performance.now drives the quarantine clock. The explicit toFake is not strictly required today — vitest's default already fakes performance — but it documents the dependency and stops a default change from silently unfaking the quarantine clock.
…tablyai#15408) * test(wsl): account for the route quarantine in stalled-mount tests stablyai#15381 added a route-level quarantine: a timed-out task blocks new admissions on that route for a back-off window, so the next real task probes recovery instead of hammering a hung mount. It merged with four tests already failing on main, and they still fail. Two causes, both test-side: - The recovery half of three tests read again immediately after releasing the stall, which the quarantine now refuses. They wait out the window, which is what a real caller does — resetting the gate would skip the admission the recovery assertions exist to prove. - `blockedRoutes` is module state that no test cleared, so a stall in one test refused an unrelated read in the next. Both files now reset the gate in beforeEach. Production behavior is unchanged and is working as designed: eviction still happens, only the immediate re-read is deferred by the back-off. * test(wsl): match the sibling suites' quarantine idiom stablyai#15381 applied this same fix to session-scanner-core-parser-wsl-stall, session-scanner-discovery-wsl-gate, and opencode-usage/scanner-wsl-gate, and missed these two files. Adopt that established shape rather than a parallel one: fold the back-off wait into releaseAndSettle instead of a separate helper at each call site, and fake performance explicitly, since performance.now drives the quarantine clock. The explicit toFake is not strictly required today — vitest's default already fakes performance — but it documents the dependency and stops a default change from silently unfaking the quarantine clock.
…tablyai#15408) * test(wsl): account for the route quarantine in stalled-mount tests stablyai#15381 added a route-level quarantine: a timed-out task blocks new admissions on that route for a back-off window, so the next real task probes recovery instead of hammering a hung mount. It merged with four tests already failing on main, and they still fail. Two causes, both test-side: - The recovery half of three tests read again immediately after releasing the stall, which the quarantine now refuses. They wait out the window, which is what a real caller does — resetting the gate would skip the admission the recovery assertions exist to prove. - `blockedRoutes` is module state that no test cleared, so a stall in one test refused an unrelated read in the next. Both files now reset the gate in beforeEach. Production behavior is unchanged and is working as designed: eviction still happens, only the immediate re-read is deferred by the back-off. * test(wsl): match the sibling suites' quarantine idiom stablyai#15381 applied this same fix to session-scanner-core-parser-wsl-stall, session-scanner-discovery-wsl-gate, and opencode-usage/scanner-wsl-gate, and missed these two files. Adopt that established shape rather than a parallel one: fold the back-off wait into releaseAndSettle instead of a separate helper at each call site, and fake performance explicitly, since performance.now drives the quarantine clock. The explicit toFake is not strictly required today — vitest's default already fakes performance — but it documents the dependency and stops a default change from silently unfaking the quarantine clock.
…tablyai#15408) * test(wsl): account for the route quarantine in stalled-mount tests stablyai#15381 added a route-level quarantine: a timed-out task blocks new admissions on that route for a back-off window, so the next real task probes recovery instead of hammering a hung mount. It merged with four tests already failing on main, and they still fail. Two causes, both test-side: - The recovery half of three tests read again immediately after releasing the stall, which the quarantine now refuses. They wait out the window, which is what a real caller does — resetting the gate would skip the admission the recovery assertions exist to prove. - `blockedRoutes` is module state that no test cleared, so a stall in one test refused an unrelated read in the next. Both files now reset the gate in beforeEach. Production behavior is unchanged and is working as designed: eviction still happens, only the immediate re-read is deferred by the back-off. * test(wsl): match the sibling suites' quarantine idiom stablyai#15381 applied this same fix to session-scanner-core-parser-wsl-stall, session-scanner-discovery-wsl-gate, and opencode-usage/scanner-wsl-gate, and missed these two files. Adopt that established shape rather than a parallel one: fold the back-off wait into releaseAndSettle instead of a separate helper at each call site, and fake performance explicitly, since performance.now drives the quarantine clock. The explicit toFake is not strictly required today — vitest's default already fakes performance — but it documents the dependency and stops a default change from silently unfaking the quarantine clock.
ELI5
Orca now "quarantines" a WSL folder for a few seconds after a read hangs, so it stops hammering a stuck drive. Four tests were written before that rule existed and still expected the very next read to work instantly, so they failed. They now wait out the short cool-off, like a real caller does — and they clean up after themselves so one test's stall can't break the next one.
What Changed
Test-only, two files (
session-scanner-index-cache-wsl-stall.test.ts,session-scanner-parse-wsl-stall.test.ts):releaseAndSettle()advances byWSL_TRANSCRIPT_FS_ROUTE_QUARANTINE_BASE_MSinstead of0.resetWslTranscriptFsGateForTests()runs first inbeforeEach.vi.useFakeTimers({ toFake: [..., 'performance'] }), sinceperformance.nowdrives the quarantine clock.Why
#15381 added a route-level quarantine (
wsl-transcript-fs-route-quarantine.ts): a timed-out task blocks new admissions on that route for a back-off window, so the next real task probes recovery instead of hammering a hung mount. Deliberate — butmainis currently red because of two test-side gaps it exposed:1. In-test recovery is refused. Each failing test stalls a read, advances past
WSL_TRANSCRIPT_FS_SCAN_TIMEOUT_MS, then re-reads expecting success. A result landing past the deadline never lifts the quarantine, so that second read hitsrouteIsBlocked()→wsl-transcript-fs-gate.ts:338rejectsWslTranscriptFsError('unavailable').2. Quarantine state leaked across tests.
blockedRoutesis module-level and no test cleared it. Every path in both files sits on one route (wsl.localhost/ubuntu), sosurfaces a refused optional JSON enrichmentquarantined the route and the next test —still degrades a missing optional JSON file to null— failed without ever stalling anything.This is the fix #15381 already shipped elsewhere. That PR applied the same three edits to
session-scanner-core-parser-wsl-stall.test.ts,session-scanner-discovery-wsl-gate.test.ts, andopencode-usage/scanner-wsl-gate.test.ts, and simply missed these two files. This PR adopts that established shape verbatim — samereleaseAndSettlewait, samebeforeEachreset, sametoFakelist, same rationale comments — rather than inventing a parallel idiom.Production behavior is unchanged and correct as designed: the cache eviction these tests are really about still happens; only the immediate re-read is deferred by the back-off. A real WSL user sees refusals for the window, then recovery.
Testing
mainis red before this change and green after — not introduced by any open PR:tests node 24 6/16,24 14/16,26 6/16,26 14/16, plusverify.a3f3a74dcf:4 failed | 2 passed. After this change:6 passed.Each edit verified load-bearing by reverting it independently:
releaseAndSettleback to advancing0beforeEachgate resetvi.useFakeTimers()Reported honestly: the explicit
toFakeis not load-bearing today — vitest's default already fakesperformance. It is kept because the sibling suites carry it and it stops a future default change from silently unfaking the quarantine clock.Neighbouring suites sharing the gate, lane pool, process client, and route machinery: 80 files / 527 tests pass (
src/main/native-chat/wsl-transcript*,src/main/ai-vault,src/main/opencode-usage/scanner-wsl-gate.test.ts).The one stalled-mount test that already passed —
refuses the stalled candidate and still parses a sibling on a healthy distro— is deliberately untouched: it reads a different route, which is why the quarantine never blocked it, and it doubles as proof the quarantine stays route-scoped.pnpm typecheckpasses.Visual Proof
N/A — test-only change, no UI surface.
Notes
No change to
wsl-transcript-fs-route-quarantine.tsor the gate. If the intended contract were instead "a released stall lifts the quarantine immediately", the fix would belong inliftRouteQuarantinecall sites — but the sibling suites #15381 did update encode the wait-it-out behavior, so this reads as intended.Checklist
mainAuthor