-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix(NODE-7308): replace process.nextTick with queueMicrotask #4817
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?
Conversation
5b9abd1 to
52b36e3
Compare
52b36e3 to
ae2e037
Compare
| // This is a guarantee in node, unless you are performing a transaction (which is not being done in this test) | ||
| expect(new Set(events.map(ev => ev.command.lsid.id.toString('hex')))).to.have.lengthOf(1); | ||
| const uniqueSessionIds = new Set(events.map(ev => ev.command.lsid.id.toString('hex'))); | ||
| expect(uniqueSessionIds).to.have.length.lessThanOrEqual(2); |
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.
Can you please elaborate on this change?
Maybe some summary from the slack thread would be good for potential future investigations, wdyt?
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.
Absolutely, adding information about the timing, as well as an example bulkWrite that would have broken the old version of this test.
Description
Summary of Changes
Replace process.nextTick() with .queueMicrotask()
What is the motivation for this change?
This helps us reduce our runtime dependencies, as part of https://jira.mongodb.org/browse/NODE-6601
Double check the following
npm run check:lint)type(NODE-xxxx)[!]: descriptionfeat(NODE-1234)!: rewriting everything in coffeescript