foo-software / lighthouse-check-action

GitHub Action for running @GoogleChromeLabs Lighthouse audits with all the bells and whistles 🔔 Multiple audits, Slack notifications, and more!
https://github.com/marketplace/actions/lighthouse-check
MIT License
478 stars 24 forks source link

Protocol timeout #58

Closed Meemaw closed 2 years ago

Meemaw commented 2 years ago

Lately we've been seeing a lot of protocol timeout errors using this action. Is this a known issue/are there any workarounds to increase that timeout?

Run foo-software/lighthouse-check-action@v4.0.0
lighthouse-check: Auditing mobile (1/4): http://localhost:3000
lighthouse-check:
 LighthouseError [LHError]: PROTOCOL_TIMEOUT
    at Timeout.<anonymous> (/home/runner/work/_actions/foo-software/lighthouse-check-action/v4.0.0/node_modules/lighthouse/lighthouse-core/gather/driver.js:322:21)
    at listOnTimeout (internal/timers.js:531:17)
    at processTimers (internal/timers.js:475:7) {
  name: 'LHError',
  code: 'PROTOCOL_TIMEOUT',
  friendlyMessage: 'Waiting for DevTools protocol response has exceeded the allotted time. (Method: Network.emulateNetworkConditions)',
  lhrRuntimeError: true,
  protocolMethod: 'Network.emulateNetworkConditions'
}
Error: PROTOCOL_TIMEOUT
adamhenson commented 2 years ago

Hello @Meemaw this is actually a Lighthouse issue. Unfortunately per the issue below, there isn't a solid solution. Not all URLs are impacted.

https://github.com/GoogleChrome/lighthouse/issues/6512

Meemaw commented 2 years ago

Hi again @adamhenson. Since I don't think underlying issue will fixed anytime soon, I'm wondering if we could do something at this action/library level.

Would retrying on this error be a possibility, with the retry count being an option passed by user.

I would like to enforce this action check in our CI, but currently its failing ~50% of times due to this error which is a no go.

adamhenson commented 2 years ago

Hi @Meemaw - that seems like it could be an idea for consideration. I opened up #62, although I can't make promises about how it's prioritized. In the meantime, you may want to consider signing up for an account with Foo. You could use this same GitHub Action to enqueue audits on Foo which have much more powerful resources than the images running on GitHub Actions. We also have built-in retry logic that tries twice in the our east cost region and then if that fails a third time in a west coast region and if that fails we try one last time using PageSpeed Insights API.