nestjs / bull

Bull module for Nest framework (node.js) :cow:
https://nestjs.com
MIT License
597 stars 98 forks source link

"Connection is closed" jest error when using bullmq > 5.1.11 #2138

Open trhodeos opened 2 months ago

trhodeos commented 2 months ago

Is there an existing issue for this?

Current behavior

When running a simple test in jest (spin up an application with a queue and a WorkerHost) and tearing down the app, we see unhandled errors from jest: Connection is Closed.

I tracked this down to this ticket / PR on the bullmq side: https://github.com/taskforcesh/bullmq/issues/2385.

Minimum reproduction code

https://github.com/trhodeos/bull

Steps to reproduce

  1. yarn install
  2. cd packages/bullmq
  3. yarn test:e2e

Expected behavior

Tests run sucessfully

Package version

10.1.1 (bullmq)

Bull version

5.1.12 (bullmq)

NestJS version

10.3.0

Node.js version

18.20.3

In which operating systems have you tested?

Other

No response

trhodeos commented 2 months ago

For a "fix", I've pinned bullmq to 5.1.11. However, it would be nice to be on the latest bullmq.

kamilmysliwiec commented 2 months ago

Would you like to create a PR for this issue?

JacobReynolds commented 3 weeks ago

I've been running into this issue as well, bullmq says the issue is fixed however upgrading to the latest version of bull does not appear to help.