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

tests: add timeout to runSmokeTest #16017

Merged
merged 2 commits into from
May 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion cli/test/smokehouse/smokehouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,18 @@ 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(new Error('Timed out waiting for provided lighthouseRunner')), 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
Loading