Skip to content

Commit

Permalink
core(driver): don't await cleanup in PAGE_HUNG case (#15833)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish authored Feb 26, 2024
1 parent 034c0a1 commit f0e144c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/gather/driver/wait-for-condition.js
Original file line number Diff line number Diff line change
Expand Up @@ -497,8 +497,10 @@ async function waitForFullyLoaded(session, networkMonitor, options) {
log.warn('waitFor', 'Timed out waiting for page load. Checking if page is hung...');
if (await isPageHung(session)) {
log.warn('waitFor', 'Page appears to be hung, killing JavaScript...');
await session.sendCommand('Emulation.setScriptExecutionDisabled', {value: true});
await session.sendCommand('Runtime.terminateExecution');
// We don't await these, as we want to exit with PAGE_HUNG
void session.sendCommand('Emulation.setScriptExecutionDisabled', {value: true})
.catch(_ => {});
void session.sendCommand('Runtime.terminateExecution').catch(_ => {});
throw new LighthouseError(LighthouseError.errors.PAGE_HUNG);
}

Expand Down

0 comments on commit f0e144c

Please sign in to comment.