nightwatchjs / nightwatch

Integrated end-to-end testing framework written in Node.js and using W3C Webdriver API. Developed at @browserstack
https://nightwatchjs.org
MIT License
11.85k stars 1.34k forks source link

Continue to run hooks and close session on uncaught errors. #4269

Open garg3133 opened 1 month ago

github-actions[bot] commented 1 month ago

Status

AutomatedTester commented 1 month ago

@reallymello I've heard this isn't working for you. Is it giving the same issue as before or is it acting differently?

reallymello commented 1 month ago

Using this PR we are getting Javascript heap out of memory errors appearing now and most of the scripts in the 39 test parallel run (10 worker threads) time out now whereas 4-8 were before. Tests appear in the "Timeout" bucket in BrowserStack turboscale when no commands are received for 90000ms I believe. This appears to be happening when the test fails and does not execute the test after block where we call browser.end nor does the global Nightwatch session termination fire. When I have been able to reproduce the issue locally the test error is logged, but the browser remains open.

Commonalities so far for tests affected seem to be on async tests when .waitUntilElementVisible is used and the element is not present or various other waitUntil loops checking for conditions fail. I think the issue is less likely to occur if .expect.present is used vs one of the waitUntil type commands is used for synchronization. We are awaiting the command.