You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the code around the runPa11yTest() function we manage the opening of the headless browser, setting of the different options, loading of the page, and handling of the results. All these steps are currently done sequentially with no error handling in place except for the whole thing being inside a try() block.
While researching #570 I've found several different ways related in which tests can fail during the handling of browser operations:
Chrome may fail to launch at all during the setBrowser step, which uses puppeteer.launch().
Loading of a specific URL may randomly cause Chrome to crash or close, disconnecting from puppeteer.
Chrome may crash or close because it's unable to run in the environment provided. For example, when running on AWS Lambda (which only supports a single process) and --single-process is not passed to puppeteer's args.
Chrome may crash at any point during the process for whatever (unknown) reason.
Currently, whenever a problem like this happens, pa11y will just exit with unhelpful error messages shown like (node:26760) UnhandledPromiseRejectionWarning: Error: Page crashed! followed by a stack trace.
I propose to improve the logic around that function, adding some error checking to those function calls so we can handle situations more gracefully, maybe retrying some actions depending on the type of error, and when not possible showing a more meaningful error message.
This would make pa11y more resilient, and less prone to suffer because of bugs in Chrome or puppeteer, and will help us in the future if we add the ability to test more than 1 page at a time.
The text was updated successfully, but these errors were encountered:
In the code around the
runPa11yTest()
function we manage the opening of the headless browser, setting of the different options, loading of the page, and handling of the results. All these steps are currently done sequentially with no error handling in place except for the whole thing being inside atry()
block.While researching #570 I've found several different ways related in which tests can fail during the handling of browser operations:
setBrowser
step, which usespuppeteer.launch()
.--single-process
is not passed to puppeteer'sargs
.Currently, whenever a problem like this happens, pa11y will just exit with unhelpful error messages shown like
(node:26760) UnhandledPromiseRejectionWarning: Error: Page crashed!
followed by a stack trace.I propose to improve the logic around that function, adding some error checking to those function calls so we can handle situations more gracefully, maybe retrying some actions depending on the type of error, and when not possible showing a more meaningful error message.
This would make pa11y more resilient, and less prone to suffer because of bugs in Chrome or puppeteer, and will help us in the future if we add the ability to test more than 1 page at a time.
The text was updated successfully, but these errors were encountered: