Closed elyran closed 2 weeks ago
Please notice the timing. It's 30 seconds.
I'd expect worker.close()
to completely close Worker
.
What could it be? Thank you
By default worker.close
will wait for the current jobs to complete, maybe your jobs are not completing in the test, or taking too much time?
The reproduction code I've added to the issue is the exact copy / paste code that actually reproduces the appearant bug 🙃 No job dispatched, so that option is ruled out. Thank you though 🙏
On Tue, Jul 16, 2024, 12:20 Manuel Astudillo @.***> wrote:
By default worker.close will wait for the current jobs to complete, maybe your jobs are not completing in the test, or taking too much time?
— Reply to this email directly, view it on GitHub https://github.com/taskforcesh/bullmq/issues/2650#issuecomment-2230421538, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAS4AOKII2UVKKGW27HOYFTZMTQU3AVCNFSM6AAAAABK3PH4EGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZQGQZDCNJTHA . You are receiving this because you authored the thread.Message ID: @.***>
I have been able to reproduce this and after a few hours trying with wtfnode I managed to improve it a bit but it all seems to boil down in that IORedis is not able to close itself perfectly every time, it may be the case that eventually it closes all the sockets but not within that second that jest is expecting it to. So not sure how to handle it, unfortunately. I will merge a PR with my improvements anyway...
Another thing, using --detectOpenHandles
as Jests suggests does not work so well either, it does not give you any further information, BUT it does not give the error either so maybe a workaround is to use that flag all the time :)
I also tried with wtfnode, didn't notice.. And I do want the warning. I want to escalate the issue to IORedis, but I'm not sure how to make the code to reproduce it, isolate it. This clearly impacts BullMQ. Any suggestion?
We could finally merge the PR #2656 after Dragonfly fixed an issue that prevented the tests from running. Hopefully the close sequence is more robust now.
I am closing now, please re-open if it is not working for you.
Version
v5.8.7
Platform
NodeJS
What happened?
Worker
causes Jest to hang 30 seconds after the test ends.How to reproduce.
docker run --rm -p 30001:6379 redis:7.2
node --inspect ./node_modules/jest/bin/jest.js --runInBand src/queue/BullMQ.test.ts
The content of
BullMQ.test.ts
:Relevant log output
Code of Conduct