tests: fix a few tests failing with INTERNAL_LANTERN_USE_TRACE#16870
tests: fix a few tests failing with INTERNAL_LANTERN_USE_TRACE#16870iamakulov wants to merge 3 commits intoGoogleChrome:mainfrom
INTERNAL_LANTERN_USE_TRACE#16870Conversation
Re-running this test over and over keeps either - succeeding - or failing because this URL is missing - or failing because of a timeout? (Even DevTools Lighthouse times out if you run it against http://localhost:10200/oopif-requests.html) I can never see the request in actual DevTools either when I open the URL. Choosing to remove the request to solve at least some flakiness.
INTERNAL_LANTERN_USE_TRACE
INTERNAL_LANTERN_USE_TRACEINTERNAL_LANTERN_USE_TRACE
| // 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'}, |
There was a problem hiding this comment.
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.
| largestContentfulPaint: 15, | ||
| traceEnd: 10_000, | ||
| frameUrl: mainDocumentUrl, | ||
| networkRecords: [Object.assign(new NetworkRequest(), mainDocumentRequest)], |
There was a problem hiding this comment.
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.)
|
|
||
| const totalSelfImpact = tasksImpactingTbt.reduce((sum, t) => sum += t.selfTbtImpact, 0); | ||
| expect(totalSelfImpact).toMatchInlineSnapshot(`2819.9999999999545`); | ||
| expect(totalSelfImpact).toBeCloseTo(2820, 6); |
There was a problem hiding this comment.
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)
This PR takes a tiny stab at #16805. It doesn’t actually fix any of the tests which have
if (process.env.INTERNAL_LANTERN_USE_TRACE)in them, but it does fix a few which were nonetheless failing withINTERNAL_LANTERN_USE_TRACE=1.Why a tiny stab? I started fixing the tests. But then I submitted #16869, which made switching to
INTERNAL_LANTERN_USE_TRACEmuch less pressing. So I decided to not pursue fixing further. Still, I figured the changes I made so far would still be useful, so I’m PRing them.