perf: reduce test/runtime overhead in plugin runtime and e2e harness

This commit is contained in:
Peter Steinberger
2026-02-13 18:24:14 +00:00
parent 3cbcba10cf
commit 39e6e4cd2c
4 changed files with 111 additions and 21 deletions

View File

@@ -2,6 +2,12 @@ import { afterAll, afterEach, beforeEach, vi } from "vitest";
// Ensure Vitest environment is properly set
process.env.VITEST = "true";
// Vitest vm forks can load transitive lockfile helpers many times per worker.
// Raise listener budget to avoid noisy MaxListeners warnings and warning-stack overhead.
const TEST_PROCESS_MAX_LISTENERS = 128;
if (process.getMaxListeners() > 0 && process.getMaxListeners() < TEST_PROCESS_MAX_LISTENERS) {
process.setMaxListeners(TEST_PROCESS_MAX_LISTENERS);
}
import type {
ChannelId,