-
Notifications
You must be signed in to change notification settings - Fork 43
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: shutdownAsync flushes the whole queue #191
Conversation
Size Change: 0 B 🆕 Total Size: 0 B |
// If we've been waiting for more than the shutdownTimeout, stop it | ||
const now = Date.now() | ||
if (startTime + timeout >= now) { | ||
break |
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.
will silently break instead of throwing an error or something since its an intended behavior.
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.
Other than a nit - love it!
@@ -43,14 +43,14 @@ | |||
"eslint-plugin-react": "^7.30.1", | |||
"eslint-plugin-react-hooks": "^4.6.0", | |||
"husky": "^8.0.1", | |||
"jest": "^28.1.3", | |||
"jest": "^29.0.0", |
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.
Relates to jestjs/jest#14741 (comment) otherwise I cannot run tests locally
@benjackwhite there's just one test failing but its unrelated to my changes I guess.
Could it be because of #189 (comment) ? edit: it was probably flaky since its green now |
oh indeed, much better, thank you! |
Problem
If the queue is bigger than
flushAt
after allpendingPromises
are resolved, some events can still be lost since flush caps toflushAt
anyway.Discussed here with @benjackwhite #177 (comment)
Changes
Instead of calling
shutdownAsync
twice, we call until the queue is empty.Release info Sub-libraries affected
Bump level
Libraries affected
Changelog notes