From cb280c526dac99bafdb91bd9447b0bad9d18ec3a Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Fri, 29 Sep 2017 11:41:11 -0700 Subject: [PATCH] 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. --- lib/Launcher.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Launcher.js b/lib/Launcher.js index 770914c8a564a..a2a326bdcb97b 100644 --- a/lib/Launcher.js +++ b/lib/Launcher.js @@ -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'); }