Commit 282e58a
committed
fix(Playwright): Properly clean up event listeners to prevent hanging
- Remove all page event listeners (crash, dialog, load, console, requestfinished) in _setPage
- Remove all browser event listeners in _stopBrowser before closing
- Add error handling for listener cleanup to prevent failures
- Wrap browser.close() and browserContext.close() in try-catch blocks
This should help prevent the Node.js event loop from staying alive due to
uncleaned event listeners, though additional investigation may be needed
for complete resolution of process hanging after tests complete.1 parent 4968282 commit 282e58a
1 file changed
+28
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1056 | 1056 | | |
1057 | 1057 | | |
1058 | 1058 | | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
1059 | 1062 | | |
1060 | 1063 | | |
1061 | 1064 | | |
| |||
1284 | 1287 | | |
1285 | 1288 | | |
1286 | 1289 | | |
1287 | | - | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
1288 | 1307 | | |
1289 | | - | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
1290 | 1316 | | |
1291 | 1317 | | |
1292 | 1318 | | |
| |||
0 commit comments