pa11y / pa11y-ci

Pa11y CI is a CI-centric accessibility test runner, built using Pa11y
https://pa11y.org
GNU Lesser General Public License v3.0
515 stars 63 forks source link

Add missing await for closing incognito browser context. #170

Closed aarongoldenthal closed 2 years ago

aarongoldenthal commented 2 years ago

Add missing await for closing incognito browser context. Errors have been seen running custom reporters with async functions, as noted in https://github.com/pa11y/pa11y-ci/issues/168#issuecomment-990562886, with the stack trace pointing to this line. The browserContext.close function is async, so without the await there appears to be timing issues between the browserContext.close and parent browser.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 https://github.com/pa11y/pa11y-ci/issues/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 https://github.com/pa11y/pa11y-ci/issues/168, so not clear if it will resolve the other issues, but those errors do also point to this line of code.

aarongoldenthal commented 2 years ago

@sangitamane Is there any chance of this being pushed out as a patch release? At a minimum async reporters using incognito are broken (or at least flaky) without it (especially when processing data in afterAll, which hold the process open at the end of the run).

sangitamane commented 2 years ago

I can merge this in master, but I am afraid if I can release it! So @josebolos or @joeyciechanowicz may release it once they are back.

joeyciechanowicz commented 2 years ago

I'm on holiday without a laptop currently, but will release when I'm back on Monday. Great work!

On Fri, 17 Dec 2021, 15:45 Sangita Mane, @.***> wrote:

Merged #170 https://github.com/pa11y/pa11y-ci/pull/170 into master.

— Reply to this email directly, view it on GitHub https://github.com/pa11y/pa11y-ci/pull/170#event-5785424325, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIYNXMUTRYL2OEWLMKX5Q3URNLITANCNFSM5JZ2K5KQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

josebolos commented 2 years ago

Released in v3.0.1. Thanks @aarongoldenthal!