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(gather-runner): convert PAGE_HUNG to non-fatal runtimeError #9121

Merged
merged 4 commits into from
Jun 5, 2019

Conversation

patrickhulce
Copy link
Collaborator

Summary
This should be last step in making all our page-load focused runtimeErrors non-fatal and exiting with an error code. This PR also cleans up some loose ends from #8865 where INSECURE_DOCUMENT_REQUEST was lying around.

Notable Changes

  • PAGE_HUNG is now in the same boat as NO_FCP, it gets special cased as a pageLoadError and is no longer fatal.
  • PAGE_HUNG does not exit with its own special exit code, it's just 1 like all the other runtimeErrors. Smoketests are now asserted via {runtimeError: {code: '...'}}
  • If a pass fails with a pageLoadError, the rest of the passes are skipped and the rest of baseArtifacts are not populated. Necessary for recovery from PAGE_HUNG and just made sense, see core(driver): security errors are no longer a fatal or pageload error #8865 (comment) step 3.
  • clearDataForOrigin will not throw PROTOCOL_TIMEOUT if it can't complete, it will just warn and move on. This is necessary for trying to recover from PAGE_HUNG in a non-fatal way, and it was one of the flagged non-responsive methods in our PROTOCOL_TIMEOUT umbrella anyhow.

Related Issues/PRs
followup according to #8865 (comment) (step 2 of the process)

Copy link
Member

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

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

seems like a good take on things. Good luck with devtools-bot :)

lighthouse-cli/test/smokehouse/smokehouse.js Outdated Show resolved Hide resolved
@@ -552,6 +552,9 @@ class GatherRunner {
const passResults = await GatherRunner.runPass(passContext);
Object.assign(artifacts, passResults.artifacts);

// If we encountered a pageLoadError, don't try to keep loading the page in future passes.
if (passResults.pageLoadError) break;
Copy link
Member

Choose a reason for hiding this comment

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

this gets a bit weird because we don't populate but still return them. All the other artifacts are either undefined, an Error, or the artifact, but we haven't until now done half-finished artifacts.

Seems ok for now, though

lighthouse-core/lib/lh-error.js Outdated Show resolved Hide resolved
clients/extension/scripts/popup.js Show resolved Hide resolved
@patrickhulce patrickhulce reopened this Jun 5, 2019
@GoogleChrome GoogleChrome deleted a comment from devtools-bot Jun 5, 2019
Copy link
Member

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants