-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
fix: update performance.now() when calling in a busy loop #35435
Conversation
This comment has been minimized.
This comment has been minimized.
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'd like Pavel to review this one, since he is more familiar with internal details of the clock.
3188710
to
0ad1bf4
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
tests/library/page-clock.spec.ts
Outdated
@@ -437,8 +437,7 @@ it.describe('while running', () => { | |||
await page.clock.install({ time: 0 }); | |||
await page.goto('data:text/html,'); | |||
await page.clock.pauseAt(1000); | |||
await page.waitForTimeout(1000); | |||
await page.clock.resume(); | |||
await page.waitForTimeout(2000); // Should not progress time. |
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.
why did this change?
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.
The test looked wrong to me (the resume call), it was testing that the paused time at 1000 corresponds to the Date.now()
call. For some unknown reason it resumed the clock afterwards. Was this intentional?
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.
Extracted into #35522.
0ad1bf4
to
d4c0c4b
Compare
Test results for "tests 1"6 failed 5 flaky39063 passed, 806 skipped Merge workflow run. |
Fixes #35362