Skip to content

core(gather-runner): covert assertPageLoaded into soft failure#4048

Merged
paulirish merged 2 commits intomasterfrom
nonfatal_https_redirect
Dec 18, 2017
Merged

core(gather-runner): covert assertPageLoaded into soft failure#4048
paulirish merged 2 commits intomasterfrom
nonfatal_https_redirect

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).


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?


// 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