-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Revert sync timeouts #7259
Revert sync timeouts #7259
Conversation
@SimenB I can do that in a different PR, as a fix. I didn't know that was part of the change and it should be properly isolated and documented in the CHANGELOG. It's just a revert of the change, so it'll preseve the behaviour about slow tests. |
Codecov Report
@@ Coverage Diff @@
## master #7259 +/- ##
==========================================
+ Coverage 66.55% 66.56% +<.01%
==========================================
Files 237 237
Lines 9317 9307 -10
Branches 4 3 -1
==========================================
- Hits 6201 6195 -6
+ Misses 3115 3111 -4
Partials 1 1
Continue to review full report at Codecov.
|
Good call, probably worth an e2e test |
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.
As long as we still mark the test as slow/able to track the time spent correctly, I'm not against this.
@SimenB do you know in what case would timeouts fail if the user mocked the Date? I'm not able to repro. |
global.Date = {now: () => 0};
test('async', async () => {
await new Promise(resolve => {
setTimeout(resolve, 50);
});
});
test('sync', () => {
for (let i = 0; i < 10000; i++) {}
}); The sync one doesn't work as you removed the eager "test started now" code. It should display at all times So not the timeouts actually, just the timing information we store on the test result |
That said, we should inject it similar to how we do More likely than |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
#7074 made sync tests fail if they finished after the defined timeout. That's a breaking change whose benefits don't compensate the upgrade cost and there's a valid workaround to implement it in userland. See the comments in #6947.
Test plan
Unit and e2e tests.