Skip to content

Commit

Permalink
tests: add timeout to runSmokeTest
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark committed May 24, 2024
1 parent 01683f5 commit 889153b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cli/test/smokehouse/smokehouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,17 @@ async function runSmokeTest(smokeTestDefn, testOptions) {

// Run Lighthouse.
try {
// Each individual runner has internal timeouts, but we've had bugs where
// that didn't cover some edge case. So to be safe give a (long) timeout here.
const timeoutPromise = new Promise((_, reject) => {
setTimeout(reject, 1000 * 120);
});
const timedResult = await Promise.race([
lighthouseRunner(requestedUrl, config, testRunnerOptions),
timeoutPromise,
]);
result = {
...await lighthouseRunner(requestedUrl, config, testRunnerOptions),
...timedResult,
networkRequests: takeNetworkRequestUrls ? takeNetworkRequestUrls() : undefined,
};

Expand Down

0 comments on commit 889153b

Please sign in to comment.