Ticket: Connection Pooling

Hello,

I’m having issues with the jest test of connection pooling. It’s just stuck at running the test indefinitely.
If I do the same change in index.js and run the status validation, it passes and I get a verification code - so I’m not stuck per se, but the test part is throwing me off regardless. Any ideas?

Can you please share the console messages and the code that you changed? Its hard to answer anything without it.

Kanika

Hard to write a console message if there is none, it’s just stuck on the test running and running and running, I terminated the test job after 5+ minutes.

The “code change” is the exact same one that passed the /status verification code, litterally copy+paste.

Hi @kisstank,

I understand your frustration. Can you still share the code for index.js file? where you have made the changes, it will help me get a better understanding.

Kanika

index.js isn’t used for the test, as the ticket says. I made the change in mongoEnvironment.js under test but even reverting back to the original file that particular test case still locks up. (doesn’t fail as it should)
index.js is used for the verification on the /status web page, and this part works.

@kisstank I get this problem fairly often. What works for me most of the time (it didn’t work one time) is clearing the cache and sometimes using another flag that is sometimes suggested by jest (can’t remember what it is right now). But maybe try clearing the cache.

  1. Open the package.json file
  2. Add the flag --clearCache to the line "test": "jest --passWithNoTests",
  3. The line should look like this: "test": "jest --passWithNoTests --clearCache",
  4. Save the package.json file
  5. Run the validation test as you normally do: npm test -t connection-pooling
  6. The only thing that will happen when you run the validation test in the line above is that you will get a message telling you that your cache has been cleared.
  7. Now delete the --clearCache flag in the package.json file, save the file, and run the validation test again.
1 Like

Thank you, @Jennifer_45288 . That actually worked for me.

EDIT: Nevermind, it worked the first time but not for the subsequent tests