Skip to content

Commit e8d0474

Browse files
committed
server exited before loadtest is fail
1 parent 2275baf commit e8d0474

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

internal/perf/src/loadtest.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import path from 'path';
22
import { setTimeout } from 'timers/promises';
33
import { ProcOptions, Server, spawn } from '@internal/proc';
4+
import { trimError } from '@internal/testing';
45

56
export interface LoadtestOptions extends ProcOptions {
67
cwd: string;
@@ -85,7 +86,14 @@ export async function loadtest(opts: LoadtestOptions) {
8586
}
8687
})();
8788

88-
await Promise.race([waitForExit, server.waitForExit]);
89+
await Promise.race([
90+
waitForExit,
91+
server.waitForExit.then(() => {
92+
throw new Error(
93+
`Server exited before the loadtest finished\n${trimError(server.getStd('both'))}`,
94+
);
95+
}),
96+
]);
8997

9098
return { memoryInMBSnapshots };
9199
}

0 commit comments

Comments
 (0)