You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
resultStore run bookkeeping leaks between tests #867
Since the per-tab results work (#842, PR #866), src/stores/resultStore.ts keeps its run bookkeeping at module level, outside the Zustand state: generations, active executions, orphaned runs and untabbed runs. useResultStore.setState(...) in a test's beforeEach resets the state but not that bookkeeping. A test that fails or times out mid-run therefore leaves its query "in flight", and later tests in the same file fail for reasons unrelated to them. The most exposed is "still counts a closed tab's statement as running until it settles", which checks that nothing is running anywhere.
How to see it
Make any test in resultStore.test.ts fail while one of its deferred() queries is still unresolved.
Run the file. Unrelated tests after it fail, for example anyTabExecuting reads true.
Fix
Export a test-only resetRunBookkeeping(), or a __resetForTests, that clears the module-level maps and counters, and call it from beforeEach in resultStore.test.ts and in the other tests that drive the real store. Alternatively, move the bookkeeping into a closure the store factory creates, so create() gives a fresh copy.
Activity
test: reset resultStore run bookkeeping per test