-
Notifications
You must be signed in to change notification settings - Fork 9.7k
tests: fix a few tests failing with INTERNAL_LANTERN_USE_TRACE
#16870
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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); | ||
|
|
@@ -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)], | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With |
||
| 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, | ||
|
|
@@ -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); | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor floating arithmetic differences with and without |
||
|
|
||
| // 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. | ||
|
|
||
There was a problem hiding this comment.
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
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.