fix: use 'close' event for seed process and deduplicate buildPerfServerEnv
- Change once(seedProcess, 'exit') to once(seedProcess, 'close') in appHarness.ts and open-perf-app.ts to ensure piped stdio buffers are fully drained before parsing stdout. - Extract buildPerfServerEnv into @t3tools/shared/perf/serverEnv to eliminate identical copies in serverPerfHarness.ts and web serverEnv.ts. Both consumers now import from the shared module.
This commit is contained in:
6 files changed
+39
-54
No files matched your search
@@ -208,7 +208,7 @@ async function seedPerfState(scenarioId: PerfSeedScenarioId): Promise<PerfSeeded
|
||||
stderr += chunk.toString();
|
||||
});
|
||||
|
||||
const [exitCode] = (await once(seedProcess, "exit")) as [number | null];
|
||||
const [exitCode] = (await once(seedProcess, "close")) as [number | null];
|
||||
if (exitCode !== 0) {
|
||||
throw new Error(`Perf seed command failed with code ${exitCode ?? "unknown"}.\n${stderr}`);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user