chore: wrap up the killTree?

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2021-10-28 20:49:47 +02:00
parent fc6c990cc9
commit 614fd12ad0
3 changed files with 100 additions and 4 deletions
+6 -2
View File
@@ -384,7 +384,9 @@ async function testAppServe(pluginName: string, appDir: string) {
} finally {
// Kill entire process group, otherwise we'll end up with hanging serve processes
if (browser) await browser.close();
killTree(startApp.pid);
await new Promise<void>((res, rej) =>
killTree(startApp.pid, err => (err ? rej(err) : res())),
);
}
try {
@@ -463,7 +465,9 @@ async function testBackendStart(appDir: string, isPostgres: boolean) {
} finally {
print('Stopping the child process');
// Kill entire process group, otherwise we'll end up with hanging serve processes
killTree(child.pid);
await new Promise<void>((res, rej) =>
killTree(child.pid, err => (err ? rej(err) : res())),
);
}
try {