Skip to content

Commit f873562

Browse files
jstirnamanCopilot
andcommitted
Update cypress/support/run-e2e-specs.js
Co-authored-by: Copilot <[email protected]>
1 parent 0d38db1 commit f873562

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cypress/support/run-e2e-specs.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,13 @@ async function main() {
125125
try {
126126
// Use SIGTERM first, then SIGKILL if needed
127127
hugoProc.kill('SIGTERM');
128-
setTimeout(() => {
128+
const timeoutId = setTimeout(() => {
129129
if (!hugoProc.killed) {
130130
hugoProc.kill('SIGKILL');
131131
}
132132
}, 1000);
133+
// Clear the timeout if the process exits cleanly
134+
hugoProc.on('exit', () => clearTimeout(timeoutId));
133135
} catch (err) {
134136
console.error(`Error killing Hugo process: ${err.message}`);
135137
}

0 commit comments

Comments
 (0)