When running tests (via Jest) that use Prisma, I g...
# prisma-client
b
When running tests (via Jest) that use Prisma, I get a warning about open handles Jest provides this info about it:
Copy code
Jest has detected the following 1 open handle potentially keeping Jest from exiting:

  ●  prisma-client-request

      35564 |       try {
      35565 |         let index = -1;
    > 35566 |         const resource = new import_async_hooks.AsyncResource("prisma-client-request");
            |                          ^
      35567 |         const params = {
      35568 |           args: internalParams.args,
      35569 |           dataPath: internalParams.dataPath,
I'm calling
prismaClient.$disconnect()
when tests are done; is there something else that I should be doing to avoid this? I wasn't sure if this is a bug or not, but if it is then I'll raise an issue on GitHub about it 🙂
r
Are you running tests in parallel or sequentially?
b
@Ryan sequentially I double-checked by using
--maxWorkers=1
, and the issue still occurs
r
Could you try it with
--runInBand
?
👍 1
b
@Ryan I still see the warning from Jest with that option (tested both without and without the maximum number of workers being set, just in case)