openclaw/docs/help/testing
Peter Steinberger 777421df55
fix(test): leaked skills watchers flake later fake-timer tests instead of failing their file (#162454)
skills.status and skill snapshot preparation start real @openclaw/fs-safe
watchers. In the shared-worker (non-isolated) Vitest lanes a file that never
closed them left them running after the module reset, unreachable, and their
re-armed poll and change-hint timers landed on whichever fake clock a later
file installed. That file's vi.runAllTimersAsync() then aborted after 10000
timers, far from the cause (session-catalog.session-share.test.ts; leaker
fixed in #162261, an earlier occurrence patched at the victim in #114751).

The non-isolated runner now remembers every real refresh.ts generation from
Vite's evaluated module graph, pairing each closeSkillsWatchers export with
the registry instance that generation imported. It captures at task
boundaries and before every vi.resetModules(), so generations a test erases
or shadows mid-test are still seen. After each file it closes leftover
watchers and fails that file with "skills watchers failed", naming it. No
production code changes.

The composite runner test gains a producer/observer pair: the producer
leaves two reset and shadowed generations open, and the observer in the next
file asserts both were closed. Without the drain, the reset wrapper, or the
import-graph pairing, the producer passes and the observer sees a live owner.
2026-10-01 06:49:49 -07:00
..
contracts.md
docker.md docs(ci): describe the single Bun-only install attempt (#161557) 2026-09-29 20:24:01 -07:00
live-workflows.md improve: profile concurrent Gateway sessions with live OpenAI (#154845) 2026-09-21 13:33:16 +00:00
qa-runners.md fix(qa): keep Telegram round-trip checks on the exercised route (#159284) 2026-09-27 16:26:01 -07:00
suites.md fix(test): unblock cold isolated runtime tests (#161497) 2026-09-29 19:22:31 -07:00
writing-tests.md fix(test): leaked skills watchers flake later fake-timer tests instead of failing their file (#162454) 2026-10-01 06:49:49 -07:00