Skip to content

Commit 3ec3a13

Browse files
Fix stopProcess signal exit handling
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
1 parent d537d94 commit 3ec3a13

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

mcp/mcp-server-e2e.test.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -256,15 +256,11 @@ async function waitForServer(
256256
)
257257
}
258258

259-
function waitForExit(proc: ChildProcess): Promise<number> {
259+
function waitForExit(proc: ChildProcess): Promise<number | null> {
260260
return new Promise((resolve, reject) => {
261261
proc.once('error', reject)
262-
proc.once('exit', (code, signal) => {
263-
if (code !== null) {
264-
resolve(code)
265-
return
266-
}
267-
reject(new Error(`Process exited from signal ${signal ?? 'unknown'}`))
262+
proc.once('exit', (code) => {
263+
resolve(code)
268264
})
269265
})
270266
}

0 commit comments

Comments
 (0)