Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

test: serve-stdin-eof-drain resets the delegated-sync runner after each test (shutdown state leaked into later files)

garrytan4ddaf9e96eb7
diff --git a/test/serve-stdin-eof-drain.test.ts b/test/serve-stdin-eof-drain.test.ts
index 0c77fd5877..09e07ed11f 100644
--- a/test/serve-stdin-eof-drain.test.ts
+++ b/test/serve-stdin-eof-drain.test.ts
@@ -26,11 +26,13 @@ import { _resetStdoutRedirectForTests } from '../src/core/console-prefix';
const __realConsoleLog = console.log;
const __realConsoleInfo = console.info;
const __realConsoleDebug = console.debug;
-afterEach(() => {
+afterEach(async () => {
console.log = __realConsoleLog;
console.info = __realConsoleInfo;
console.debug = __realConsoleDebug;
_resetStdoutRedirectForTests();
+ // runServe's shutdown marks the delegated-sync runner shutting down; later files in this process start delegated syncs.
+ (await import('../src/core/serve-sync-runner')).__resetDelegatedSyncForTests();
});
/* eslint-enable no-console */