- 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.
Showing the changes to scripts (1 of 6 files). Show all
Unified · Split
| @@ -208,7 +208,7 @@ async function seedPerfState(scenarioId: PerfSeedScenarioId): Promise<PerfSeeded · 207 unmodified lines | |||
| 208 | stderr += chunk.toString(); | 208 | stderr += chunk.toString(); |
| 209 | }); | 209 | }); |
| 210 | 210 | ||
| 211 | const [exitCode] = (await once(seedProcess, "exit")) as [number | null]; | 211 | const [exitCode] = (await once(seedProcess, "close")) as [number | null]; |
| 212 | if (exitCode !== 0) { | 212 | if (exitCode !== 0) { |
| 213 | throw new Error(`Perf seed command failed with code ${exitCode ?? "unknown"}.\n${stderr}`); | 213 | throw new Error(`Perf seed command failed with code ${exitCode ?? "unknown"}.\n${stderr}`); |
| 214 | } | 214 | } |