fix(Launcher): Terminate chrome gracefully on Windows (#876)

This patch starts using taskkill program on windows to gracefully
terminate chrome.

Note: this slows down chrome shutdown on Windows in case of using
custom userDataDir. This is because chrome takes some time to shutdown
its operations and leave profile directory in a consistent state.

Fixes #839.
This commit is contained in:
Andrey Lushnikov 2017-09-29 11:41:11 -07:00 committed by GitHub
parent f6255029bd
commit cb280c526d

View File

@ -129,7 +129,7 @@ class Launcher {
} else {
// Terminate chrome gracefully.
if (process.platform === 'win32')
chromeProcess.kill();
childProcess.execSync(`taskkill /pid ${chromeProcess.pid}`);
else
process.kill(-chromeProcess.pid, 'SIGTERM');
}