QueueScheduler & QueueEvents make the test suite suspend
See original GitHub issueThis is the simplified version of our code base to reproduce the bug.
const Redis = require('ioredis')
const {QueueScheduler} = require('bullmq')
const connection1 = new Redis(6379, 'localhost')
let queueScheduler;
describe('test', ()=>{
beforeAll(()=>{
queueScheduler = new QueueScheduler('q1', {connection: connection1})
})
afterAll(async()=>{
await queueScheduler.close()
// await connection1.quit()
}, 10000)
it('nothin', ()=>{
expect(true).toBe(true)
})
})
The expected behavior is that teardown phase should successfully close the connection and test should end smoothly, but when running the test, it’s suspended and throws this warnings:
Jest did not exit one second after the test run has completed.
This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with `--detectOpenHandles` to troubleshoot this issue.
When run the test with --detectOpenHandles option it complains about the Redis connection and Queuescheduler.
This condition makes our CI pipeline fail randomly because of timeout limit and I’m looking for a way to close the connections smoothly.
Environment:
bullmq: 1.44.2
ioredis: 4.27.8
redis: 6.0.9
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
Changelog - BullMQ
The QueueScheduler class is removed since it is not necessary anymore. Delayed jobs are now handled in a much simpler and robust way,...
Read more >So how does RxJS QueueScheduler actually work?
If we use queueScheduler — then rx.js just adds all values to scheduler queue ... It starts emitting if argument observables (a$ and...
Read more >bee-queue - npm
A simple, fast, robust job/task queue for Node.js, backed by Redis. Simple: ~1000 LOC, and minimal dependencies.
Read more >VMware Tanzu Greenplum 6 Documentation
Stop Words. 834. Simple Dictionary. 835. Synonym Dictionary. 836. Thesaurus Dictionary. 838. VMware Tanzu Greenplum 6 Documentation.
Read more >Converged Network Adapters (41000 Series) [Dell] - Marvell
Installing Linux Drivers Using the src RPM Package . ... WARNING: DO NOT STOP THIS PROCESS OR INSTALL OTHER DELL PRODUCTS WHILE UPDATE....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I just copied your snippet and run it, but the error still exists. this is my environment:
node: 14.15.5bullMQ: 1.46.1ioredis: 4.27.8redis: tried with6.0.9-alpineandlatestimages(I run the Redis through container).Would you tell about your environment? Is there any difference between yours and mine?
@shahinghasemi I tried your piece of code, and you need to close connection1 too: