Upgrade to MongoDB 4.x causing cucumber tests to hang after test complete

Cucumber tests are currently running successfully and passing, however the process is not closing upon completion on mongodb v4.2.2. The tests run and close properly in version 3.7.3 and lower.

Here’s a screenshot of the test when run and hangs. Seen the process sit there without completing/closing for as long as 40 mins. Tried running the test through azure pipeline as well to rule out and local environment issues. Test in Azure pipeline also hangs.

Tech details:

Node v16.13.1
cucumber 8.0.0-rc.1

Welcome to the MongoDB Community Forums @Riane_Vardeleon !

We can’t provide much advice based on a screenshot, but your example looks like a test that is running for 19s rather than 40 minutes.

Some suggested next steps and further information that would be helpful:

  • Can you provide some detail on the code or functions that are taking significantly longer to run with the newer Node.js driver version? A minimal test case that reproduces the issue would be great.

  • Did you upgrade any other software at the same time as your driver version upgrade (Node.js, MongoDB server, non-driver npm dependencies, …)?

  • Have you reviewed the Node.js 4.0 driver upgrade documentation?

  • Have you tried with the latest stable version of Cucumber (currently 7.3.1) rather than the 8.0.0 release candidate?

Regards,
Stennie

Hi Stennie,

I am a coworker of Riane and I’m taking over this problem that we are still having when upgrading to MongoDB 4.x. We verified this occurs when upgrading from Mongo 3.7.3 to 4.4. We also narrowed down the problem to this dependency by doing our upgrades one at a time. We have tried Cucumber 7.3.1 but it also breaks when upgrading Mongo to 4.4.1.

The problem occurs after all the cucumber tests pass, it’s stuck in the state as the screenshot shared by Riane. The tests pass in 19s but the entire process never ends.

We’re not sure how to go about upgrading Mongo to the latest version. Verbose mode with npm also doesn’t help since it also just hangs after the tests are completed.

I just reviewed node-mongodb-native/CHANGES_4.0.0.md at 4.0 · mongodb/node-mongodb-native · GitHub and it doesn’t appear there is anything that would break our tests. We are running Node 16 and the minimum it suggests is Node 12.