Skip to content

Commit 6bd2953

Browse files
committed
Fix: Remove premature process.exit() that prevented test summary from printing
- Removed 2-second auto-exit from _afterSuite() hook - Increased auto-exit delay in _cleanup() from 2s to 5s to allow Mocha/test runners to print summary statistics - Test summaries now print correctly before process exits - Addresses issue where GitHub Actions logs showed no test count/summary
1 parent b1a609a commit 6bd2953

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

lib/helper/Playwright.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -869,16 +869,6 @@ class Playwright extends Helper {
869869
this.testFailures.push(`Final cleanup failed: ${e.message}`)
870870
}
871871

872-
// Schedule a delayed exit to prevent process hanging due to Playwright event loops
873-
// This is especially important for BROWSER_RESTART=browser mode where afterSuite is the final cleanup
874-
// Give it 2 seconds for any pending operations to complete
875-
if (!process.env.CODECEPT_DISABLE_AUTO_EXIT) {
876-
setTimeout(() => {
877-
// Force exit with the current exit code (0 for success, non-zero for failures)
878-
process.exit(process.exitCode || 0)
879-
}, 2000).unref()
880-
}
881-
882872
// Clean up session pages explicitly to prevent hanging references
883873
try {
884874
if (this.sessionPages && Object.keys(this.sessionPages).length > 0) {
@@ -994,13 +984,11 @@ class Playwright extends Helper {
994984
}
995985

996986
// Schedule a delayed exit to prevent process hanging due to Playwright event loops
997-
// This ensures the process exits even if Playwright has active handles
998-
// Give it 2 seconds for any pending operations to complete
987+
// Wait 5 seconds to allow test runner to print summary statistics before exiting
999988
if (!process.env.CODECEPT_DISABLE_AUTO_EXIT) {
1000989
setTimeout(() => {
1001-
// Force exit with the current exit code (0 for success, non-zero for failures)
1002990
process.exit(process.exitCode || 0)
1003-
}, 2000).unref()
991+
}, 5000).unref()
1004992
}
1005993
}
1006994

0 commit comments

Comments
 (0)