Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Fix: use lolex only for setTimeout function to avoid mongodb to stall #2425

Merged
merged 1 commit into from
Oct 9, 2020

Conversation

brianunlam
Copy link
Contributor

@brianunlam brianunlam commented Oct 9, 2020

Basically since version 3.6.2 mongodb library has replaced processWaitQueue with setImmediate.

lolex.install() is monkey patching setImmediate which is causing mongodb library to stall.

Here you can see more details about this:

mongodb/node-mongodb-native#2537

Automattic/mongoose#9417

So, in order to solve the problem we will only use lolex for setTimeout and not for other clock methods.

It fixes: #2412 (comment)

Copy link
Owner

@DeviaVir DeviaVir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appreciate the detailed explanation, thank you for the PR!

@DeviaVir DeviaVir merged commit df5422b into DeviaVir:unstable Oct 9, 2020
xwolfyxNL added a commit to xwolfyxNL/zenbot that referenced this pull request Jan 5, 2021
Reverts commit DeviaVir#2425 and fixes the broken sim results
@xwolfyxNL xwolfyxNL mentioned this pull request Jan 5, 2021
DeviaVir pushed a commit that referenced this pull request Jan 6, 2021
Reverts commit #2425 and fixes the broken sim results
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zenbot sim stall/timeout in 4.1.0 unstable
2 participants