Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions cli/test/smokehouse/test-definitions/dobetterweb.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,8 @@ const expectations = {
},
},
'image-delivery-insight': {
score: '<0.5',
metricSavings: {LCP: '>2000'},
score: 0.5,
metricSavings: {LCP: 0},
details: {
debugData: {wastedBytes: '>1100000'},
items: [
Expand Down
4 changes: 2 additions & 2 deletions core/test/audits/__snapshots__/metrics-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Object {
"firstContentfulPaintAllFrames": undefined,
"firstContentfulPaintAllFramesTs": undefined,
"firstContentfulPaintTs": undefined,
"interactive": 2865,
"interactive": 3427,
"interactiveTs": undefined,
"largestContentfulPaint": 1059,
"largestContentfulPaintAllFrames": undefined,
Expand Down Expand Up @@ -116,7 +116,7 @@ Object {
"firstContentfulPaintAllFrames": undefined,
"firstContentfulPaintAllFramesTs": undefined,
"firstContentfulPaintTs": undefined,
"interactive": 2865,
"interactive": 3427,
"interactiveTs": undefined,
"largestContentfulPaint": 1059,
"largestContentfulPaintAllFrames": undefined,
Expand Down
6 changes: 3 additions & 3 deletions core/test/audits/__snapshots__/predictive-perf-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ Object {
"optimisticFCP": 1059,
"optimisticLCP": 1059,
"optimisticSI": 261,
"optimisticTTI": 1816,
"optimisticTTI": 2556,
"pessimisticFCP": 1059,
"pessimisticLCP": 1059,
"pessimisticSI": 1109,
"pessimisticTTI": 3723,
"pessimisticTTI": 4139,
"roughEstimateOfFCP": 1059,
"roughEstimateOfLCP": 1059,
"roughEstimateOfLCPLoadDelay": undefined,
"roughEstimateOfLCPLoadDuration": undefined,
"roughEstimateOfSI": 1059,
"roughEstimateOfTTFB": 638,
"roughEstimateOfTTI": 2865,
"roughEstimateOfTTI": 3427,
}
`;
12 changes: 6 additions & 6 deletions core/test/audits/metrics-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ describe('Performance: metrics', () => {
const result = await MetricsAudit.audit(artifacts, context);
if (process.env.INTERNAL_LANTERN_USE_TRACE !== undefined) {
// The devtoolsLog includes 2 high-priority CORS `Preflight` requests that are not emitted
// as `ResourceSendRequest` trace events, which lowers simulated TTI from 2865ms to 2588ms.
expect(result.details.items[0].interactive).toBe(2588);
result.details.items[0].interactive = 2865;
// as `ResourceSendRequest` trace events, which lowers simulated TTI from 3427ms to 3111ms.
expect(result.details.items[0].interactive).toBe(3111);
result.details.items[0].interactive = 3427;
}
expect(result.details.items[0]).toMatchSnapshot();
});
Expand Down Expand Up @@ -127,9 +127,9 @@ describe('Performance: metrics', () => {
const result = await MetricsAudit.audit(artifacts, context);
if (process.env.INTERNAL_LANTERN_USE_TRACE !== undefined) {
// The devtoolsLog includes 2 high-priority CORS `Preflight` requests that are not emitted
// as `ResourceSendRequest` trace events, which lowers simulated TTI from 2865ms to 2588ms.
expect(result.details.items[0].interactive).toBe(2588);
result.details.items[0].interactive = 2865;
// as `ResourceSendRequest` trace events, which lowers simulated TTI from 3427ms to 3111ms.
expect(result.details.items[0].interactive).toBe(3111);
result.details.items[0].interactive = 3427;
}
expect(result.details.items[0]).toMatchSnapshot();
});
Expand Down
16 changes: 8 additions & 8 deletions core/test/audits/predictive-perf-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ describe('Performance: predictive performance audit', () => {
if (process.env.INTERNAL_LANTERN_USE_TRACE !== undefined) {
// The devtoolsLog includes 2 high-priority CORS `Preflight` requests that are not emitted
// as `ResourceSendRequest` trace events, which lowers simulated TTI in trace mode.
expect(output.displayValue).toBeDisplayString('2,590 ms');
expect(output.displayValue).toBeDisplayString('3,110 ms');
expect(metrics).toMatchObject({
optimisticTTI: 1658,
pessimisticTTI: 3349,
roughEstimateOfTTI: 2588,
optimisticTTI: 2240,
pessimisticTTI: 3823,
roughEstimateOfTTI: 3111,
});
metrics.optimisticTTI = 1816;
metrics.pessimisticTTI = 3723;
metrics.roughEstimateOfTTI = 2865;
metrics.optimisticTTI = 2556;
metrics.pessimisticTTI = 4139;
metrics.roughEstimateOfTTI = 3427;
} else {
expect(output.displayValue).toBeDisplayString('2,860 ms');
expect(output.displayValue).toBeDisplayString('3,430 ms');
}
expect(metrics).toMatchSnapshot();
});
Expand Down
9 changes: 7 additions & 2 deletions core/test/computed/metrics/lcp-breakdown-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,13 @@ describe('LCPBreakdown', () => {
const result = await LCPBreakdown.request(data, {computedCache: new Map()});

expect(result.ttfb).toBeCloseTo(1245.5, 0.1);
expect(result.loadDelay).toBeCloseTo(2183.6, 0.1);
expect(result.loadDuration).toBeCloseTo(383.7, 0.1);
if (process.env.INTERNAL_LANTERN_USE_TRACE !== undefined) {
expect(result.loadDelay).toBeCloseTo(1149.1, 0.1);
expect(result.loadDuration).toBeCloseTo(268.0, 0.1);
} else {
expect(result.loadDelay).toBeCloseTo(2183.6, 0.1);
expect(result.loadDuration).toBeCloseTo(383.7, 0.1);
}
});

it('returns breakdown for a real trace with text LCP', async () => {
Expand Down
3 changes: 2 additions & 1 deletion core/test/computed/tbt-impact-tasks-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ describe('TBTImpactTasks', () => {
startTime: task.startTime * linearScale,
endTime: task.endTime * linearScale,
duration: task.duration * linearScale,
queuedTime: 0,
});
}

Expand Down Expand Up @@ -270,7 +271,7 @@ describe('TBTImpactTasks', () => {
expect(totalSelfImpact).toBeCloseTo(3195.07, 2);
} else {
expect(tasksImpactingTbt.length).toMatchInlineSnapshot(`7374`);
expect(totalSelfImpact).toMatchInlineSnapshot(`2819.9999999999673`);
expect(totalSelfImpact).toMatchInlineSnapshot(`2819.9999999999727`);
}

// Only tasks with no children should have a `selfTbtImpact` that equals `tbtImpact` if
Expand Down
26 changes: 13 additions & 13 deletions core/test/fixtures/lantern-baseline-accuracy.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"roughEstimateOfFCP": {
"p50": 0.39069767441860465,
"p90": 1.0909438288116164,
"p95": 1.8804301075268817
"p50": 0.35921787709497205,
"p90": 1.1497898356897212,
"p95": 2.075698924731183
},
"roughEstimateOfSI": {
"p50": 0.37806637806637805,
"p90": 1.1903480099980772,
"p95": 1.599556119213697
"p50": 0.37121721587088097,
"p90": 1.2514900980580657,
"p95": 1.61572606214331
},
"roughEstimateOfTTI": {
"p50": 0.2778836987607245,
"p50": 0.265890400430405,
"p90": 0.6610608020698577,
"p95": 1.0465116279069768
},
"roughEstimateOfLCP": {
"p50": 0.40073260073260075,
"p90": 2.303610906411201,
"p50": 0.3708433734939759,
"p90": 2.345246868091378,
"p95": 3.855187319884726
},
"roughEstimateOfTTFB": {
Expand All @@ -25,13 +25,13 @@
"p95": 0.6009791921664627
},
"roughEstimateOfLCPLoadDelay": {
"p50": 2.120096768619319,
"p90": 24.373626373626372,
"p50": 2.379432624113475,
"p90": 25.065934065934066,
"p95": 35.06
},
"roughEstimateOfLCPLoadDuration": {
"p50": 0.7675438596491229,
"p90": 0.9793842137592138,
"p50": 0.7593706617306802,
"p90": 0.9786931818181818,
"p95": 1
}
}
Loading
Loading