Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core(session): ignore protocol timeouts from puppeteer #15512

Closed
wants to merge 2 commits into from

Conversation

adamraine
Copy link
Member

Fixes #15510

@adamraine adamraine requested a review from a team as a code owner October 3, 2023 20:28
@adamraine adamraine requested review from brendankenny and removed request for a team October 3, 2023 20:28
@vercel
Copy link

vercel bot commented Oct 3, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lighthouse ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 3, 2023 8:29pm

const resultPromise = this._cdpSession.send(method, ...params).catch(err => {
// We set up our own protocol timeout system, so we should ignore protocol timeouts emitted by puppeteer.
// https://github.com/GoogleChrome/lighthouse/issues/15510
if (/'protocolTimeout'/.test(err)) return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this resolve with undefined, though, if timeoutPromise doesn't win the race?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I guess if puppeteer gives us a protocol timeout error that means they are done processing the command. Even if we wait around longer, we won't get a result.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose an better solution would be to just ignore this type of error for our Page.navigate call specifically? IDK but this clearly needs more work.

@adamraine
Copy link
Member Author

This won't work because puppeteer will cut off the command response even if Lighthouse is still waiting. I think what we need is for puppeteer to allow setting a timeout on individual commands.

@adamraine adamraine closed this Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prevent puppeteer protocol timeouts
4 participants