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
Flaky: navigation-service #915 ancestor tests fail intermittently in the full suite (singleton sharedNodeStore not cleared) #2020
src/tests/services/navigation-service.test.ts — the "Entity node navigation (Issue #915)" tests ("primitive text node under date still resolves to date ancestor", "deeply nested primitive walks up to nearest viewer-owning ancestor") fail intermittently only in the full bun run test run, never in isolation (39/39 pass alone). Observed blocking the pre-push gate non-deterministically; passes on retry.
Root cause
The test uses the singletonsharedNodeStore (imported real, not mocked) and its beforeEach only calls resetTabState() — it never clears the store. Under vitest's pool: 'forks', multiple test files share a worker process, so nodes/structure-tree edges other files setNode into the shared store persist into navigation-service's fork. The #915 ancestor-walk resolves against that polluted structure and can land on the wrong ancestor. Which files share its fork is non-deterministic, so adding any unrelated test file can surface it (this is how it was noticed — an unrelated new test file in a different PR flipped the ordering).
Fix
Clear the shared store (and structure tree) in navigation-service.test.ts's beforeEach (e.g. sharedNodeStore.clear() / the store's reset API) so each case starts from a known-empty graph, independent of sibling files. Audit other suites that use the real sharedNodeStore for the same gap.
Impact
Test-only; no product bug. But it flakes the pre-push gate for everyone (this device + Michael), costing retries.
Activity
Isolate navigation-service tests from sibling-file store pollution (#…