lighthouse 12.0.0-dev.20240522 → 12.0.0-dev.20240524
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -163,8 +163,18 @@ async function runSmokeTest(smokeTestDefn, testOptions) {
|
|
|
163
163
|
|
|
164
164
|
// Run Lighthouse.
|
|
165
165
|
try {
|
|
166
|
+
// Each individual runner has internal timeouts, but we've had bugs where
|
|
167
|
+
// that didn't cover some edge case. So to be safe give a (long) timeout here.
|
|
168
|
+
const timeoutPromise = new Promise((_, reject) => {
|
|
169
|
+
setTimeout(() =>
|
|
170
|
+
reject(new Error('Timed out waiting for provided lighthouseRunner')), 1000 * 120);
|
|
171
|
+
});
|
|
172
|
+
const timedResult = await Promise.race([
|
|
173
|
+
lighthouseRunner(requestedUrl, config, testRunnerOptions),
|
|
174
|
+
timeoutPromise,
|
|
175
|
+
]);
|
|
166
176
|
result = {
|
|
167
|
-
...
|
|
177
|
+
...timedResult,
|
|
168
178
|
networkRequests: takeNetworkRequestUrls ? takeNetworkRequestUrls() : undefined,
|
|
169
179
|
};
|
|
170
180
|
|
|
@@ -8,9 +8,10 @@ export class NetworkMonitor extends NetworkMonitor_base {
|
|
|
8
8
|
/**
|
|
9
9
|
* Finds all time periods where the number of inflight requests is less than or equal to the
|
|
10
10
|
* number of allowed concurrent requests.
|
|
11
|
+
* The time periods returned are in ms.
|
|
11
12
|
* @param {Array<LH.Artifacts.NetworkRequest>} requests
|
|
12
13
|
* @param {number} allowedConcurrentRequests
|
|
13
|
-
* @param {number=} endTime
|
|
14
|
+
* @param {number=} endTime In ms
|
|
14
15
|
* @return {Array<{start: number, end: number}>}
|
|
15
16
|
*/
|
|
16
17
|
static findNetworkQuietPeriods(requests: Array<LH.Artifacts.NetworkRequest>, allowedConcurrentRequests: number, endTime?: number | undefined): Array<{
|
|
@@ -202,9 +202,10 @@ class NetworkMonitor extends NetworkMonitorEventEmitter {
|
|
|
202
202
|
/**
|
|
203
203
|
* Finds all time periods where the number of inflight requests is less than or equal to the
|
|
204
204
|
* number of allowed concurrent requests.
|
|
205
|
+
* The time periods returned are in ms.
|
|
205
206
|
* @param {Array<LH.Artifacts.NetworkRequest>} requests
|
|
206
207
|
* @param {number} allowedConcurrentRequests
|
|
207
|
-
* @param {number=} endTime
|
|
208
|
+
* @param {number=} endTime In ms
|
|
208
209
|
* @return {Array<{start: number, end: number}>}
|
|
209
210
|
*/
|
|
210
211
|
static findNetworkQuietPeriods(requests, allowedConcurrentRequests, endTime = Infinity) {
|
|
@@ -215,10 +216,9 @@ class NetworkMonitor extends NetworkMonitorEventEmitter {
|
|
|
215
216
|
if (UrlUtils.isNonNetworkProtocol(request.protocol)) return;
|
|
216
217
|
if (request.protocol === 'ws' || request.protocol === 'wss') return;
|
|
217
218
|
|
|
218
|
-
|
|
219
|
-
timeBoundaries.push({time: request.networkRequestTime * 1000, isStart: true});
|
|
219
|
+
timeBoundaries.push({time: request.networkRequestTime, isStart: true});
|
|
220
220
|
if (request.finished) {
|
|
221
|
-
timeBoundaries.push({time: request.networkEndTime
|
|
221
|
+
timeBoundaries.push({time: request.networkEndTime, isStart: false});
|
|
222
222
|
}
|
|
223
223
|
});
|
|
224
224
|
|
package/package.json
CHANGED