Enhance TestRig with process management and timeouts (#15908)

This commit is contained in:
N. Taylor Mullen
2026-01-06 23:58:13 -08:00
committed by GitHub
parent 5fe5d1da46
commit 416d243027
4 changed files with 205 additions and 111 deletions

View File

@@ -25,6 +25,16 @@ export function registerSyncCleanup(fn: () => void) {
syncCleanupFunctions.push(fn);
}
/**
* Resets the internal cleanup state for testing purposes.
* This allows tests to run in isolation without vi.resetModules().
*/
export function resetCleanupForTesting() {
cleanupFunctions.length = 0;
syncCleanupFunctions.length = 0;
configForTelemetry = null;
}
export function runSyncCleanup() {
for (const fn of syncCleanupFunctions) {
try {