You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Steps to reproduce
Step to reproduce
Create a new nest project : nest new nest-app
Install dependencies : npm i @nestjs/bullmq ioredis
Start a redis instance on default port 6379
Create this 2 files
app.service.ts
import{Injectable}from'@nestjs/common';import{Job,Queue,Worker}from'bullmq';importRedis,{RedisOptions}from'ioredis';
@Injectable()exportclassAppService{privatequeue: Queue;privateworker: Worker;privateredis: Redis;connect(){constredisConfig: RedisOptions={host: 'localhost',port: 6379,autoResubscribe: false,lazyConnect: true,maxRetriesPerRequest: 0,reconnectOnError: null,enableOfflineQueue: true,};this.redis=newRedis(redisConfig);this.queue=newQueue('queue1',{connection: this.redis});this.worker=newWorker('queue1',async(job)=>{console.log('PROCESS')awaitthis.wait({});console.log('DONE')returnjob;},{connection: this.redis},);// Replace by this line and it works// this.worker = new Worker('queue1', '', { connection: this.redis });}asyncdisconnect(): Promise<void>{awaitthis.queue.close();awaitthis.worker.close();awaitthis.redis.quit();}asyncwait({ seconds =1}: {seconds?: number}): Promise<void>{awaitnewPromise((resolve)=>setTimeout(resolve,seconds*1000));}}
Is there an existing issue for this?
Current behavior
The test is still running with
Steps to reproduce
Step to reproduce
app.service.ts
app.service.spec.ts
Expected behavior
The test just succeed
Package version
10.0.1
Bull version
4.7.0
NestJS version
10.0.0
Node.js version
16.20.1
In which operating systems have you tested?
Other
npm : 9.8.1
The text was updated successfully, but these errors were encountered: