Add missing await for closing incognito browser context. #170
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add missing
await
for closing incognito browser context. Errors have been seen running custom reporters with async functions, as noted in #168 (comment), with the stack trace pointing to this line. ThebrowserContext.close
function is async, so without theawait
there appears to be timing issues between thebrowserContext.close
and parentbrowser.close
(which are likely masked in other cases by pa11y-ci completing and exiting the process).This change did resolve at least the reporter problem noted in #168 (as did running with
"useIncognitoBrowserContext": false
as a workaround). The build-in reporters (cli
/html
) are only synchronous code and don't appear to cause it.I haven't seen this with other execution as noted in #168, so not clear if it will resolve the other issues, but those errors do also point to this line of code.