-
-
Notifications
You must be signed in to change notification settings - Fork 752
Fix browser hanging during cleanup by not waiting for browser.close() to complete #5319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…t restart Co-authored-by: kobenguyent <[email protected]>
|
@copilot workflows got timeout like playwright tests. It's likely the process hangs. |
…ed first Co-authored-by: kobenguyent <[email protected]>
I've identified and fixed the issue. The previous approach of mapping The root cause is that Changes:
This should resolve the timeout issue in both the test execution and CI workflows. |
|
@copilot still got 5-sec hang after text execution with latest changes |
…pproach Co-authored-by: kobenguyent <[email protected]>
... Fixed in commit c91d94c. The issue was that The new approach uses "fire and forget" - we call Changes:
This should eliminate the 5-second hang completely. |
|
verified it worked |
Motivation/Description of the PR
Tests hang for 5 seconds after completion in CodeceptJS 4.x when using the default
restart: falseconfiguration for Playwright helper.Resolves #5317
Applicable helpers:
Applicable plugins:
Type of change
Root Cause
The
browser.close()operation in_stopBrowser()hangs indefinitely in certain scenarios, causing a 5-second timeout. Even after attempting to close all pages and contexts first, the browser.close() operation itself still hangs due to internal Playwright/browser process state that prevents clean shutdown.Changes
lib/helper/Playwright.js_stopBrowser()method to use "fire and forget" approach:browser.close()withoutawait- don't wait for it to completeThis approach initiates browser cleanup but doesn't wait for it, allowing the test execution to complete immediately. The browser process will be cleaned up when the Node process exits.
Example
With default config:
Before: Test completes in 4ms, hangs 5s before exit
After: Test completes in 4ms, exits immediately
Benefits
false,true,'context','session','browser'Checklist:
npm run docs)npm run lint)npm test)Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.