-
Notifications
You must be signed in to change notification settings - Fork 189
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
Tests need to close Redis connections to pass #116
Conversation
I had to update
|
OK, CI is green now! If a few of you will review this, we can merge and start trusting our CI reports. |
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.
I can confirm package-lock.json
is correct since I had the same amount of changes (261 changes) after running npm install
for #114, but I didn't add it since I was just changing documentation.
I tested this change on my machine and everything seems to be working fine.
You get this error now when running the test without Redis server on:
(node:46320) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 127.0.0.1:6379
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
(node:46320) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:46320) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Can create a new issue to catch this error and display a more user friend error message. This may help jestjs/jest#5311
@ImmutableBox I asked @aprilllllllll about this in #48 (comment), where she was talking about the same problem. I agree, we need an issue filed on this, and a more helpful error message so people understand what's happened. |
Our one and only test is currently failing:
The problem here is that Bull holds open a connection to Redis (which it should), so that it can listen for more jobs to get added to the queue(s). This blocks the tests from finishing. The solution is to ask Bull to close the connection when the tests are done.
I've also fixed the test so that it returns the expected Promise for an async test.