From f8735626679c7ad5cc68fbfb4d7d5d574b5b3909 Mon Sep 17 00:00:00 2001 From: Jason Stirnaman Date: Mon, 28 Jul 2025 17:40:28 -0500 Subject: [PATCH] Update cypress/support/run-e2e-specs.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- cypress/support/run-e2e-specs.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cypress/support/run-e2e-specs.js b/cypress/support/run-e2e-specs.js index fa77a8465..caf0e42fa 100644 --- a/cypress/support/run-e2e-specs.js +++ b/cypress/support/run-e2e-specs.js @@ -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}`); }