mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-02 13:01:34 +00:00
The core-runtime-media-ui shard runs its ui config non-isolated for speed, but the full chat-pane lifecycle tests instantiate the pane component, which relies on chat-thread/chat-message module-level singletons (thread-state map, confirmation dismisser WeakMap, module-scoped document context-menu listeners) and spies on those modules. Under the shared non-isolated graph a stateful predecessor file can leave those modules duplicated, so the pane binds to a different instance than the test's spy/registry -- producing order-dependent flakes: `removeEventListener`-not-called teardown assertions or 120s session-lifecycle hangs. Reproduced deterministically on a Linux Node 24 Testbox (MAX_WORKERS=1); isolating a single file only shifted the failure to a sibling pane test, so the whole full-pane family shares the fragility. Route the 7 full-pane lifecycle test files through a new isolated jsdom lane (vitest.ui-isolated.config.ts, isolate: true) for a fresh module graph; the other ~370 ui tests stay fast and non-isolated. Registered in both shard registries (ci-node-test-plan.mjs, vitest.test-shards.mjs) and excluded from vitest.ui.config.ts. Verified on Testbox: the deterministic single-worker media-ui shard goes from failing to 5182 passed / 0 failed. Test-infrastructure only; no product code changes.