test: harden threaded shared-worker suites

This commit is contained in:
Peter Steinberger
2026-03-24 08:36:10 +00:00
parent e7817ad12a
commit 43131dcc08
20 changed files with 110 additions and 24 deletions

View File

@@ -1,6 +1,7 @@
import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import { cleanupSessionStateForTest } from "../../src/test-utils/session-state-cleanup.js";
type EnvValue = string | undefined | ((home: string) => string | undefined);
@@ -129,6 +130,7 @@ export async function withTempHome<T>(
try {
return await fn(base);
} finally {
await cleanupSessionStateForTest().catch(() => undefined);
restoreExtraEnv(envSnapshot);
restoreEnv(snapshot);
try {