chore: do not log process not found warning on win when PID is not found (#7500)

This commit is contained in:
Max Schmitt 2021-07-07 19:40:09 +02:00 committed by GitHub
parent a481de0871
commit ee0497c725
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -173,7 +173,7 @@ export async function launchProcess(options: LaunchProcessOptions): Promise<Laun
// Force kill the browser.
try {
if (process.platform === 'win32') {
const stdout = childProcess.execSync(`taskkill /pid ${spawnedProcess.pid} /T /F`);
const stdout = childProcess.execSync(`taskkill /pid ${spawnedProcess.pid} /T /F /FI "MEMUSAGE gt 0"`);
options.log(`[pid=${spawnedProcess.pid}] taskkill output: ${stdout.toString()}`);
} else {
process.kill(-spawnedProcess.pid, 'SIGKILL');