-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
fix: allow chain call timeout to override nested items timeout #5612
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?
fix: allow chain call timeout to override nested items timeout #5612
Conversation
…ed in chain call Signed-off-by: hainenber <dotronghai96@gmail.com>
Signed-off-by: hainenber <dotronghai96@gmail.com>
Signed-off-by: hainenber <dotronghai96@gmail.com>
…ted-items-timeout
This reverts commit 18a70c9.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5612 +/- ##
=======================================
Coverage 88.40% 88.41%
=======================================
Files 66 66
Lines 4787 4791 +4
Branches 977 977
=======================================
+ Hits 4232 4236 +4
Misses 555 555 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| setTimeout(resolve, 55); | ||
| }); | ||
| }); | ||
| }).timeout(70); |
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.
hmm, I'm not sure how timeout(70) and timeout(100) result in different behavior when we have setTimeout(resolve, 55). Would replacing 70 with 40 clarify things? Do we need two tests for this?
Some code comments might be useful here :)
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 chained timeout calls are meant to imply that the outermost timeout value would override for nested test cases and suites. In general, timeout(100) would take precedence over other timeout configs.
We'll definitely need 2 test to illustrate for nested and deeply nested cases :D
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've added code comments for clarity, that is if sufficient.
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 think I'll extend the timeout a bit higher than the default value, 2 second, to illustrate the fix better. Con is that the test will be slightly longer.
Edit: Done
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'm a little new to the codebase and I'm sorry if I'm out of line here but it seems like these are arbitrary values that indicate a deeper root issue and this seems to be a bandaid fix?
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.
No worries. These are arbitrary values in some sample tests to demonstrate that the new sleep values do actually apply. The backing bug was reported because in main*, with something like describe( ... ).timeout(100);, the timeout(100) call didn't do anything at all.
While I haven't reviewed the latest iterations, the goal is to write a test that only passes if timeout(...) works as designed on both describe and test.
But this isn't a bandaid fix, because these are just sample tests :)
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.
Makes sense now :)
Co-authored-by: Mark Wiemer <7833360+mark-wiemer@users.noreply.github.com>
Signed-off-by: hainenber <dotronghai96@gmail.com>
…clearer Signed-off-by: hainenber <dotronghai96@gmail.com>
…ted-items-timeout
…ted-items-timeout
PR Checklist
describenot working as expected #5422status: accepting prsOverview
Fixes the issue with
timeoutchain call indescribesuite doesn't correctly override the config for inner/nested suite and test cases.