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

Page timeout => PROTOCOL_TIMEOUT on Network.emulateNetworkConditions #11427

Open
paulirish opened this issue Sep 13, 2020 · 4 comments
Open

Page timeout => PROTOCOL_TIMEOUT on Network.emulateNetworkConditions #11427

paulirish opened this issue Sep 13, 2020 · 4 comments
Assignees
Labels

Comments

@paulirish
Copy link
Member

paulirish commented Sep 13, 2020

Unexpected error... if you have a page that times out because it never finishes loading.. Lighthouse actually completes with this:

Runtime error encountered: Waiting for DevTools protocol response has exceeded the allotted time. (Method: Network.emulateNetworkConditions) LHErr or: PROTOCOL_TIMEOUT

verbose log sample
 status Gathering devtoolsLog & network records +0ms
  NetworkRecorder:verbose network semi-quiet +1ms
  statusEnd:verbose Gathering devtoolsLog & network records +0ms
  method => browser:verbose Network.emulateNetworkConditions {"latency":0,"downloadThroughput":0,"uploadThroughput":0,"offline":fals +0ms
  status Disconnecting from browser... +30s
  method => browser:verbose Storage.clearDataForOrigin {"origin":"http://localhost:10200","storageTypes":"appcache,file_systems,inde +2ms
  ChromeLauncher Killing Chrome instance 99316 +5ms
  <= event:verbose Inspector.detached {"reason":"Render process gone."} +36ms
  <= event:verbose Network.loadingFailed {"requestId":"5970A7A16C2CA4015516F5FDD6F076B2","timestamp":182731.290164,"type":"Document" +1ms
  NetworkRecorder:verbose network fully-quiet +0ms
  <= event:verbose Inspector.detached {"reason":"target_closed"} +0ms
  method <= browser OK:verbose Page.navigate {"frameId":"266F9C9AE5626FD51485D206C87C0D8F","loaderId":"5970A7A16C2CA4015516F5FDD6F07 +0ms
Runtime error encountered: Waiting for DevTools protocol response has exceeded the allotted time. (Method: Network.emulateNetworkConditions)
LHEr ror: PROTOCOL_TIMEOUT
    at Timeout._onTimeout (~/code/lighthouse/lighthouse-core/gather/driver.js:352:21)
    at listOnTimeout (internal/timers.js:531:17)
    at processTimers (internal/timers.js:475:7)

repro:

  • yarn static-server
  • node lighthouse-cli "http://localhost:10200/online-only.html?delay=75000"

The emulateNetworkConditions call comes from here:

// Disable throttling so the afterPass analysis isn't throttled
await driver.setThrottling(passContext.settings, {useThrottling: false});

and if that line is commented out.. we'd get The page provided is not HTML (served as MIME type ) as both a runtimeError and runWarning.

It's possible this root cause (a page that never loads) is what's behind some of these filed emulateNetworkConditions issues.


Possible LH fix: adding explicit detection of a page timeout.
Possible Chrome fix: Network.emulateNetworkConditions shouldn't timeout if the page is in a ~hung state.

@devtools-bot

This comment has been minimized.

@devtools-bot

This comment has been minimized.

@patrickhulce
Copy link
Collaborator

More broadly I want to try to almost completely eliminate PROTOCOL_TIMEOUT by adding a version of sendCommand that checks to see if Chrome is truly hung and just moves on if it's still responding. Yes, it technically represents something unexpected but the Lighthouse failure case is so painful and there's so little movement to ever actually fix any of these in Chromium (and I believe unrealistic to expect all of them to ever be fixed). Commands whose return type is void don't need to become fatal if Chrome never acks them...

@paulirish
Copy link
Member Author

Possible LH fix: adding explicit detection of a page timeout.

we'll do this. timeout if the document itself is taking a longass time.
tricky part is figuring out what we skip in this case. if we're doing cleanup we dont want the cleanup protocol cmds to also hang

Possible Chrome fix: Network.emulateNetworkConditions shouldn't timeout if the page is in a ~hung state.

i'll file a bug for this.

More broadly I want to try to almost completely eliminate PROTOCOL_TIMEOUT

sounds good, too.

@paulirish paulirish self-assigned this Nov 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants