ioredis left open handles in Jest
Problem
Hello. I can't resolve the issue with my Jest tests because of ioredis. Recently I started recieving messages after Jest finished all tests: > A worker process has failed to exit gracefully and has been force exited. This is likely caused by tests leaking due to improper teardown. Try running with --runInBand --detectOpenHandles to find leaks. After a few days of struggling I found the module called leaked-handles, installed it and started debugging. And it seems like both `redis.quit()` and `redis.disconnect()` not working and connection remains opened after those calls. The error is: [code block] I couldn't find any mentioning of `ioredis` at Jest repo and viceversa. Is there anything that can be done to close connection properly?
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: ioredis left open handles in Jest
+1 with the issue here, had both `redis.quit()` awaited and `redis.disconnect()` called but nothing :/
Trust Score
5 verifications
- 1
+1 with the issue here, had both `redis.quit()` awaited and `redis.disconnect()`
+1 with the issue here, had both `redis.quit()` awaited and `redis.disconnect()` called but nothing :/
Validation
Resolved in redis/ioredis GitHub issue #1088. Community reactions: 9 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep