Skip to content

Commit

Permalink
fix(testing): close cypress web server correctly on windows (#22125)
Browse files Browse the repository at this point in the history
(cherry picked from commit 2d9ecfd)
  • Loading branch information
leosvelperez authored and FrozenPandaz committed Mar 8, 2024
1 parent 774c59c commit f8f2942
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/cypress/plugins/cypress-preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,13 @@ function startWebServer(webServerCommand: string) {
});

return () => {
// child.kill() does not work on linux
// process.kill will kill the whole process group on unix
process.kill(-serverProcess.pid, 'SIGKILL');
if (process.platform === 'win32') {
serverProcess.kill();
} else {
// child.kill() does not work on linux
// process.kill will kill the whole process group on unix
process.kill(-serverProcess.pid, 'SIGKILL');
}
};
}

Expand Down

0 comments on commit f8f2942

Please sign in to comment.