Skip to content
Open
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
2 changes: 0 additions & 2 deletions cli/test/smokehouse/test-definitions/oopif-requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ const expectations = {

// Disqus iframe (OOPIF)
{url: /^https:\/\/disqus\.com\/embed\/comments\//, finished: true, statusCode: 200, resourceType: 'Document'},
// Disqus subframe (that's a new OOPIF)
{url: 'https://accounts.google.com/o/oauth2/iframe', finished: true, statusCode: 200, resourceType: 'Document'},
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test was really flaky. Re-running this test over and over kept either

  • succeeding
  • or failing because this URL was missing
  • or, weirdly, failing because of a Lighthouse’s timeout? (Even DevTools Lighthouse times out if you run it against http://localhost:10200/oopif-requests.html)

I can’t see this URL in actual DevTools no matter how many times I reload http://localhost:10200/oopif-requests.html or https://www.paulirish.com/2012/why-moving-elements-with-translate-is-better-than-posabs-topleft/ (which it wraps). So I assumed the URL was there in earlier version of Disqus, or maybe is loaded very intermittently, and decided to drop it.

],
},
},
Expand Down
24 changes: 14 additions & 10 deletions core/test/computed/tbt-impact-tasks-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {getURLArtifactFromDevtoolsLog, readJson} from '../test-utils.js';
import {createTestTrace, rootFrame} from '../create-test-trace.js';
import {networkRecordsToDevtoolsLog} from '../network-records-to-devtools-log.js';
import {MainThreadTasks} from '../../computed/main-thread-tasks.js';
import {NetworkRequest} from '../../lib/network-request.js';

const trace = readJson('../fixtures/artifacts/cnn/trace.json.gz', import.meta);
const devtoolsLog = readJson('../fixtures/artifacts/cnn/devtoolslog.json.gz', import.meta);
Expand All @@ -32,25 +33,28 @@ describe('TBTImpactTasks', () => {
let metricComputationData;

beforeEach(() => {
/** @type {Partial<LH.Artifacts.NetworkRequest>} */
const mainDocumentRequest = {
requestId: '1',
priority: 'High',
networkRequestTime: 0,
networkEndTime: 500,
transferSize: 400,
url: mainDocumentUrl,
frameId: rootFrame,
};
metricComputationData = {
trace: createTestTrace({
largestContentfulPaint: 15,
traceEnd: 10_000,
frameUrl: mainDocumentUrl,
networkRecords: [Object.assign(new NetworkRequest(), mainDocumentRequest)],
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With INTERNAL_LANTERN_USE_TRACE, the test needed networkRecords to be present. (Coincidentally, with INTERNAL_LANTERN_USE_TRACE, the test also doesn’t need devtoolsLog, but I’m not removing it because the CDP branch still needs it.)

topLevelTasks: [
// Add long task to defer TTI
{ts: 1000, duration: 1000},
],
}),
devtoolsLog: networkRecordsToDevtoolsLog([{
requestId: '1',
priority: 'High',
networkRequestTime: 0,
networkEndTime: 500,
transferSize: 400,
url: mainDocumentUrl,
frameId: rootFrame,
}]),
devtoolsLog: networkRecordsToDevtoolsLog([mainDocumentRequest]),
URL: {
requestedUrl: mainDocumentUrl,
mainDocumentUrl,
Expand Down Expand Up @@ -266,7 +270,7 @@ describe('TBTImpactTasks', () => {
expect(tasksWithNoChildren).toEqual(tasksWithAllSelfImpact);

const totalSelfImpact = tasksImpactingTbt.reduce((sum, t) => sum += t.selfTbtImpact, 0);
expect(totalSelfImpact).toMatchInlineSnapshot(`2819.9999999999545`);
expect(totalSelfImpact).toBeCloseTo(2820, 6);
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor floating arithmetic differences with and without INTERNAL_LANTERN_USE_TRACE :)

Snapshot name: `TBTImpactTasks works on real artifacts with lantern 2`

Snapshot: 2819.9999999999545
Received: 2819.999999999922
    at Context.<anonymous> (file:///Users/iamakulov/Repos/lighthouse/core/test/computed/tbt-impact-tasks-test.js:269:31)


// Total self blocking time is just the total self impact without factoring in the TBT
// bounds, so it should always be greater than or equal to the total TBT self impact.
Expand Down