-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
tests: fix flaky cache test #12606
tests: fix flaky cache test #12606
Conversation
@@ -116,6 +116,11 @@ describe('Cache headers audit', () => { | |||
}); | |||
|
|||
it('respects expires/cache-control priority', () => { | |||
// Stub Date.now so the test is not sensitive to timing. | |||
const now = Date.now(); |
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.
could make the argument that this should be in a beforeAll. thoughts?
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.
I would make that argument yes :)
@@ -116,6 +116,11 @@ describe('Cache headers audit', () => { | |||
}); | |||
|
|||
it('respects expires/cache-control priority', () => { | |||
// Stub Date.now so the test is not sensitive to timing. | |||
const now = Date.now(); |
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.
I would make that argument yes :)
|
how does time pass if date.now is constant. sppoky time |
so no to switching the audit off of |
it seems like from lighthouse/lighthouse-core/audits/byte-efficiency/uses-long-cache-ttl.js Lines 118 to 124 in a938fc4
auditing with lighthouse/lighthouse-core/audits/byte-efficiency/uses-long-cache-ttl.js Lines 222 to 228 in a938fc4
so would never show up in the audit? I realize this is expanding the scope of the intended fix, so this can also be a new issue :) |
merging in interest of less flaky tests. i'll write a new issue but can't take it right away. |
fixes #11772