-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Have the global timeout take into account t.timeout() durations #2758
Conversation
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.
Thanks for turning this into a PR!
You're right that debounce()
isn't a direct fit for this. It's perhaps also unnecessary now that we can use https://nodejs.org/docs/latest-v12.x/api/timers.html#timers_timeout_refresh. But maybe that's beside the point.
I don't think the timeout has to be accurate. The goal is for the global timeout to not fire when a test is waiting for a longer period. Perhaps we can think of these t.timeout()
calls as preventing the global timeout from firing. We can compute the timestamp before which, if it fires, it should simply restart the timer. What do you think?
I've updated the
If this approach looks good, I'll proceed with adding fresh tests specific to the new changes. This still leaves |
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.
Thanks @OhYash! I've pushed some small changes (and merged main
). CI is a bit choppy now but some runs should pass…
Thanks @novemberborn for fixing some of the unnecessary changes I've made. I've fixed the CI tests and added one |
Added a test for stateChange event emitted by notifyTimeoutUpdate |
Thanks @OhYash! |
Finally! After me stretching it for too long 😅. |
Thank you @OhYash! @novemberborn will this be included in a release soon? Seems like there hasn't been a release since January. |
@mikob we're working towards AVA 4. I'm hoping to put another prerelease of that out soon. |
This PR attempts to allow tests to run beyond the global limit (which is 10s default).
See #2384 for details.
Tests cases and documentation pending until the
debounce()
wait period can be overridden.