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): covert assertPageLoaded into soft failure #4048

Merged
merged 2 commits into from
Dec 18, 2017

Conversation

patrickhulce
Copy link
Collaborator

@patrickhulce patrickhulce commented Dec 13, 2017

closes #1978 according to feedback in #2461

converts the assertPageLoaded into a soft failure that just fails every gatherer afterPass

if more than half of all artifacts failed due to page load failure then the error becomes fatal (like the case where you try to audit http://total-junk-hostname).

log.verbose('statusEnd', status);

pageLoadError = GatherRunner.getPageLoadError(options.url, networkRecords);
// If the driver was offline, a page load error is expected, so do not save it.
if (!driver.online) pageLoadError = null;
Copy link
Member

Choose a reason for hiding this comment

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

can we do this check within getPageLoadError? seems reasonable.

Copy link
Collaborator Author

@patrickhulce patrickhulce Dec 14, 2017

Choose a reason for hiding this comment

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

heh, I explicitly moved it out of there since it felt like it was in the wrong place over there :)

In fact I'd eventually want to remove this special check entirely to make the passes on similar footing. Is it primarily the extra line here that you don't like?

@@ -319,8 +329,10 @@ class GatherRunner {
const artifacts = {};

// Nest LighthouseRunWarnings, if any, so they will be collected into artifact.
gathererResults.LighthouseRunWarnings = [gathererResults.LighthouseRunWarnings];
const uniqueWarnings = Array.from(new Set(gathererResults.LighthouseRunWarnings));
Copy link
Member

Choose a reason for hiding this comment

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

would it be worthwhile to change LighthouseRunWarnings to be a set instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

eh, it's not clear when we would do the flip back to array needed for JSON.stringify, so I'm not necessarily sold. since we were already manipulating it here and aggregating across multiple passes, seems reasonable to de-dupe but let audits keep track of it on their own

});
});
}, Promise.resolve()).then(_ => {
// Fail the run if more than 50% of all audits failed due to page load failure.
Copy link
Member

Choose a reason for hiding this comment

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

"50% of all audits" => "50% of all artifacts"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oh oops, yeah done :)

@paulirish paulirish merged commit 3f9d94c into master Dec 18, 2017
@paulirish paulirish deleted the nonfatal_https_redirect branch December 18, 2017 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Site Redirects HTTP Traffic to HTTPS shouldn't stop the execution if failling
2 participants