openclaw/test/e2e
Peter Steinberger 931c7b40b2
fix(test): first test or hook times out while compiled worker subprocesses prepare (#162792)
* fix(test): load compiled-subprocess declarations at collection

The first load of a compiled-subprocess declaration in a Vitest invocation
prepares the whole compiled worker generation (tens of seconds warm, minutes
cold). 387 test files first reached a declaration through an await import()
inside a test body or hook, so their first test or hook absorbed that
preparation and could time out.

Move those loads to collection at their owner: static subject imports,
static imports in the shared helpers that owned the lazy load, and a named
side-effect preload (src/test-utils/prepare-compiled-subprocesses.ts) for
suites that re-import their subject per test or whose first load happens in
production code they call. plugin-test-runtime keeps the host-capability
fixture lazy so its other consumers do not start loading that graph.
Document the rule in docs/help/testing/writing-tests.md.

335 of the 387 files now load their first declaration before collection
ends; 52 remain (48 extension tests needing an SDK preload, one package
test, three files over the line cap).

* fix(test): retain npm install fixture reuse

Preserve the existing failedSpawn reuse after merging main so the collection-time preload stays within the line-cap ratchet. Assertions and import ordering are unchanged.

* fix(test): keep memory-core facade cold-import assertion meaningful

The static subject import ran before beforeEach reset the loader mock, so the cold-import assertion passed vacuously. Restore the in-test subject imports after mock setup and preload the compiled-subprocess declaration during collection instead.
2026-10-01 11:42:59 -07:00
..
qa-lab fix(test): first test or hook times out while compiled worker subprocesses prepare (#162792) 2026-10-01 11:42:59 -07:00
cloudflare-oidc-visitors.e2e.test.ts fix: invite GitHub visitors without a public email (#162666) 2026-10-01 17:12:53 +01:00
crabbox-sandbox.live.test.ts feat(crabbox): add a lease-backed sandbox backend for tool-call isolation (#144454) 2026-09-11 15:16:30 -07:00
doctor-json-errors.built-cli.e2e.test.ts fix(test): align CLI release fixtures with runtime owners (#157780) 2026-09-25 14:11:51 -07:00
gateway-transcripts-discord-capture.e2e.test.ts fix(test): first test or hook times out while compiled worker subprocesses prepare (#162792) 2026-10-01 11:42:59 -07:00
line-doctor-group-allowlist.built-cli.e2e.test.ts fix(line): keep doctor from granting unintended group access (#147135) 2026-09-13 22:05:47 +05:30
mattermost-send-owner.e2e.test.ts fix: stop Mattermost posts after sender cancellation (#151252) 2026-09-18 02:17:20 +01:00
telegram-model-button-identity.e2e.test.ts fix(telegram): prevent stale model buttons selecting another provider (#150880) 2026-09-17 18:52:57 +05:30