Skip to content

Commit 952a266

Browse files
committed
Forcefully kill existing Chrome if gently Windows kill fails
1 parent 3afbf1d commit 952a266

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/interceptors/chromium-based-interceptors.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,18 @@ abstract class ExistingChromiumBasedInterceptor implements Interceptor {
231231

232232
if (process.platform === 'win32') {
233233
windowsClose(existingPid);
234+
235+
try {
236+
await waitForExit(existingPid);
237+
} catch (e) {
238+
// Try again, but less gently this time:
239+
process.kill(existingPid);
240+
await waitForExit(existingPid);
241+
}
234242
} else {
235243
process.kill(existingPid);
244+
await waitForExit(existingPid);
236245
}
237-
238-
await waitForExit(existingPid);
239246
}
240247

241248
const browserDetails = await getBrowserDetails(this.config, this.variantName);

0 commit comments

Comments
 (0)