Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

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

Max Schmittee0497c7259e
diff --git a/src/server/processLauncher.ts b/src/server/processLauncher.ts
index a8939be2bc..aaf6eb37ce 100644
--- a/src/server/processLauncher.ts
+++ b/src/server/processLauncher.ts
@@ -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');