Update cypress/support/run-e2e-specs.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
pull/6257/head
Jason Stirnaman 2025-07-28 17:40:28 -05:00
parent 0d38db18e3
commit f873562667
1 changed files with 3 additions and 1 deletions

View File

@ -125,11 +125,13 @@ async function main() {
try {
// Use SIGTERM first, then SIGKILL if needed
hugoProc.kill('SIGTERM');
setTimeout(() => {
const timeoutId = setTimeout(() => {
if (!hugoProc.killed) {
hugoProc.kill('SIGKILL');
}
}, 1000);
// Clear the timeout if the process exits cleanly
hugoProc.on('exit', () => clearTimeout(timeoutId));
} catch (err) {
console.error(`Error killing Hugo process: ${err.message}`);
}