We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2275baf commit e8d0474Copy full SHA for e8d0474
internal/perf/src/loadtest.ts
@@ -1,6 +1,7 @@
1
import path from 'path';
2
import { setTimeout } from 'timers/promises';
3
import { ProcOptions, Server, spawn } from '@internal/proc';
4
+import { trimError } from '@internal/testing';
5
6
export interface LoadtestOptions extends ProcOptions {
7
cwd: string;
@@ -85,7 +86,14 @@ export async function loadtest(opts: LoadtestOptions) {
85
86
}
87
})();
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
+ ]);
97
98
return { memoryInMBSnapshots };
99
0 commit comments