Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jest has detected the following 1 open handle potentially keeping Jest from exiting: CustomGC #18146

Closed
ctsstc opened this issue Feb 28, 2023 · 48 comments
Labels
bug/2-confirmed Bug has been reproduced and confirmed. domain/client Issue in the "Client" domain: Prisma Client, Prisma Studio etc. kind/bug A reported bug. topic: jest

Comments

@ctsstc
Copy link

ctsstc commented Feb 28, 2023

Bug description

When I run jest --detectOpenHandles I get the following:
(Which seems to stem from the Prisma Client)

Jest has detected the following 1 open handle potentially keeping Jest from exiting:

  ●  CustomGC

      at Runtime._loadModule (../node_modules/jest-runtime/build/index.js:1111:29)
      at load (../node_modules/@prisma/client/runtime/library.js:73:326)
      at ../node_modules/@prisma/client/runtime/library.js:73:759
      at runInChildSpan (../node_modules/@prisma/client/runtime/library.js:70:25817)
      at Fr.loadLibrary (../node_modules/@prisma/client/runtime/library.js:73:677)
      at Vt.loadEngine (../node_modules/@prisma/client/runtime/library.js:101:557)
      at Vt.instantiateLibrary (../node_modules/@prisma/client/runtime/library.js:100:1478)

How to reproduce

npx jest --detectOpenHandles

Expected behavior

There should be no open handles left over from Jest tests to prisma. There should be no open DB handles anyways since the tests are not connecting a database.

Prisma information

Cannot share on the given project unfortunately.

Environment & setup

  • OS: macOS
  • Database: PostgreSQL
  • Node.js version: v16.15.1

Prisma Version

prisma                  : 4.11.0
@prisma/client          : 4.11.0
Current platform        : darwin-arm64
Query Engine (Node-API) : libquery-engine 8fde8fef4033376662cad983758335009d522acb (at node_modules/@prisma/engines/libquery_engine-darwin-arm64.dylib.node)
Migration Engine        : migration-engine-cli 8fde8fef4033376662cad983758335009d522acb (at node_modules/@prisma/engines/migration-engine-darwin-arm64)
Format Wasm             : @prisma/prisma-fmt-wasm 4.11.0-57.8fde8fef4033376662cad983758335009d522acb
Default Engines Hash    : 8fde8fef4033376662cad983758335009d522acb
Studio                  : 0.483.0
@ctsstc ctsstc added the kind/bug A reported bug. label Feb 28, 2023
@janpio janpio added bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. domain/client Issue in the "Client" domain: Prisma Client, Prisma Studio etc. topic: jest labels Mar 2, 2023
@thomasmarren
Copy link

Also seeing this.

It looks like it was introduced in v4.9.0. Downgrading to v4.8.1 removes the message.

@cbix
Copy link

cbix commented Mar 6, 2023

Worth noting this happens with

generator client {
  provider = "prisma-client-js"
}

The --detectOpenHandles flag is only supposed to help debugging aync operations that keep jest from exiting. As long as you are not using --forceExit and jest doesn't get stuck with a warning after running your tests, I wouldn't worry too much about it.

Unlike other database connections we're using in our tests (e.g. knex), prisma doesn't seem to require any explicit teardown in order for jest to exit cleanly, however an await prismaClient.$disconnect() wouldn't hurt.

The main issue I see with this warning about the open prisma handle is that it hides the actual source of the issue from the user. E.g. if jest gets stuck due to an unclosed connection from knex and I use --detectOpenHandles to debug this, it would lead me to the wrong assumption that prisma is at fault.

FYI running with DEBUG="prisma:client:libraryEngine":

  prisma:client:libraryEngine  internalSetup +0ms
  prisma:client:libraryEngine  library starting +793ms
  prisma:client:libraryEngine  library started +87ms
  prisma:client:libraryEngine  sending request, this.libraryStarted: true +51ms
  prisma:client:libraryEngine  requestBatch +18ms
  prisma:client:libraryEngine  sending request, this.libraryStarted: true +60ms
  prisma:client:libraryEngine  library stopping +201ms
  prisma:client:libraryEngine  library stopped +2ms

@aravind605
Copy link

aravind605 commented Mar 7, 2023

Also seeing this.

It looks like it was introduced in v4.9.0. Downgrading to v4.8.1 removes the message.
Jest still exiting causing test suite to fail even after downgrading to 4.8.1

Environment and Setup
prisma : 4.8.1
@prisma/client : 4.8.1
jest : 29.2.2
testcontainers :9.0.1
OS: macOS
Database: PostgreSQL 14
Node.js version: v19.2.0

Executes all the test cases and fails at the end with following error
Screenshot 2023-03-07 at 4 49 22 PM
appended by
Jest has detected the following 1 open handle potentially keeping Jest from exiting:

● CustomGC

  at Runtime._loadModule (../node_modules/jest-runtime/build/index.js:1111:29)
  at load (../node_modules/@prisma/client/runtime/library.js:73:326)
  at ../node_modules/@prisma/client/runtime/library.js:73:759
  at runInChildSpan (../node_modules/@prisma/client/runtime/library.js:70:25817)
  at Fr.loadLibrary (../node_modules/@prisma/client/runtime/library.js:73:677)
  at Vt.loadEngine (../node_modules/@prisma/client/runtime/library.js:101:557)
  at Vt.instantiateLibrary (../node_modules/@prisma/client/runtime/library.js:100:1478)

Please let me know if I you need additional info

@thomasmarren
Copy link

@aravind605 I'm not sure your issue is directly related to this.

At least in my case, the open handle message does not cause the test suite to fail, it's just a warning when using --detectOpenHandles.

@aravind605
Copy link

aravind605 commented Mar 8, 2023

@aravind605 I'm not sure your issue is directly related to this.

At least in my case, the open handle message does not cause the test suite to fail, it's just a warning when using --detectOpenHandles.

In my case this is my jest config

module.exports = {
  preset: "ts-jest",
  testEnvironment: "node",
  displayName: {
    name: "node-express",
    color: "greenBright",
  },
  testTimeout: 120000,
  verbose: true,
  detectOpenHandles: true,
  collectCoverage: true,
  forceExit: true,
  moduleDirectories: ["node_modules", "src"]
};

I'm using detect open handles flag and observe that every test case succeed but at the end suite fails which I believe prisma client is not gracefully closing down and still attempting to search for active connection after the container stopped.

image

@james-julius
Copy link

Also seeing this - downgrading to 4.8.1 makes no difference to me

@andrewmclagan
Copy link

Can confirm that ^4.11.0 causes open handle issue. Downgrading to 4.8.1 removes the issue.

@andrewmclagan
Copy link

I created a repository to reproduce the issue: https://github.com/andrewmclagan/prisma-open-handles

It seems it only happens when using pnpm and could possibly be related to this issue, although I think likely its another issue. As this only starts happening on version ^4.11.0

@ctsstc
Copy link
Author

ctsstc commented Mar 10, 2023

@andrewmclagan I'm using npm and see the issue.

@mehdibo
Copy link

mehdibo commented Mar 11, 2023

Same problem here. I tried downgrading to 4.8.1 and calling $disconnect after all tests but still the same issue.

@ImLunaHey
Copy link

Using npm myself and hitting this so it's definitely not just pnpm.

@aravind605
Copy link

I've observed this might concern only when we attempt to write integration tests with prisma/client library. But not when the lib is mocked.

@rodrigocipriani
Copy link

I'm having the same issue here. And it's causing Garbage Collector not to work well and so Heap Memory is huge after some test files. I've tested 4.8.1 and 4.11.0.

@luizamoorim
Copy link

I have the same issue and the Heap size is increasing a lot after writing some tests files like @rodrigocipriani has mentioned.
I tested lots of approaches to close this warning and decrease memory consumption with Jest + Prisma but without success.

@alexey2baranov
Copy link

it's not just minor issue. it brokes our pipeline on current project. probably by timeout.

@aravind605
Copy link

aravind605 commented Mar 20, 2023

it's not just minor issue. it brakes the pipeline on current project. probably by timeout.

true it breaks pipeline. Anyone got it successfully passing the bdd tests? please let me know the version you have?

@onadeemdev
Copy link

same issue, had to downgrade to 4.7.0 for it to work

@rodrigocipriani
Copy link

Here 4.7.0 didn't work. Same problem.

@aravind605
Copy link

4.7.0 didn't work for me.

@avery-sungage
Copy link

We also see this bug on 4.3.1

@rossmotley
Copy link

rossmotley commented Mar 29, 2023

I suspect this might be an issue with something else interacting with prisma. I encountered the issue after doing a an npm update which updated prisma and @prisma/client from 4.9.0 to 4.12.0 (among other things).
However, after updating just the prisma packages with npm install @prisma/client@4.12.0 prisma@4.12.0, I am not seeing the issue.

Turns out that I got a tests-not-exiting issue caused by another library (bullmq+nestjs) following an npm update. That was causing my jest e2e test suite to hang and not exit. When investigating with --detectOpenHandles I saw the Prisma CustomGC warning, so initially thought the issue was Prisma.

So I am seeing a CustomGC warning from Prisma 4.12.0, but my tests still exit/finish.

@ctsstc
Copy link
Author

ctsstc commented Mar 30, 2023

I think tests will always exit/finish, I think there's a timeout/threshold for how long a test can take before it skips and continues. This is likely why you see the error, but it will always finish.

I do not have bullmq as a dependency but this is a Nest JS project that I'm seeing this on.

@rodrigocipriani
Copy link

Libraries I'm using:

"dependencies": {
    "@opentelemetry/api": "^1.3.0",
    "@opentelemetry/auto-instrumentations-node": "^0.36.0",
    "@opentelemetry/exporter-trace-otlp-http": "^0.35.0",
    "@opentelemetry/sdk-node": "^0.35.0",
    "@prisma/client": "^4.11.0",
    "@splitsoftware/splitio": "^10.21.1",
    "@types/express-rate-limit": "^5.1.3",
    "@types/rate-limit-redis": "^1.7.4",
    "@types/redis": "^2.8.32",
    "assert-plus": "^1.0.0",
    "cls-hooked": "^4.2.2",
    "dotenv": "^16.0.3",
    "express": "^4.17.3",
    "express-rate-limit": "^5.3.0",
    "kafkajs": "^2.0.2",
    "lusca": "^1.7.0",
    "module-alias": "^2.2.2",
    "mongodb": "^4.13.0",
    "node-fetch": "^2.6.7",
    "pg": "^8.7.3",
    "rate-limit-redis": "^2.1.0",
    "redis": "^3.1.2",
    "tsoa": "^5.1.1",
    "winston": "^3.6.0"
  },
  "devDependencies": {
    "@faker-js/faker": "^7.1.0",
    "@guidecx/config-prettier": "^1.0.0",
    "@types/assert-plus": "^1.0.4",
    "@types/cls-hooked": "^4.3.3",
    "@types/cors": "^2.8.12",
    "@types/eslint": "^7.28.0",
    "@types/express": "^4.17.6",
    "@types/jest": "^29.4.2",
    "@types/lusca": "^1.7.1",
    "@types/node": "^16.18.16",
    "@types/node-fetch": "^2.6.1",
    "@types/supertest": "^2.0.11",
    "@typescript-eslint/eslint-plugin": "^5.48.0",
    "@typescript-eslint/parser": "^5.48.0",
    "concurrently": "^7.0.0",
    "copyfiles": "^2.4.1",
    "cross-env": "^7.0.3",
    "docker-compose": "^0.23.17",
    "dotenv-cli": "^6.0.0",
    "eslint": "^7.32.0",
    "eslint-config-prettier": "^8.3.0",
    "husky": "^7.0.4",
    "jest": "^29.5.0",
    "lint-staged": "^12.3.7",
    "nodemon": "^2.0.12",
    "prettier": "2.3.2",
    "prisma": "^4.11.0",
    "supertest": "^6.1.4",
    "ts-jest": "^29.0.5",
    "ts-node": "^10.9.1",
    "typescript": "^4.9.4",
    "uuid-random": "^1.3.2"
  }

@dengelke
Copy link

dengelke commented Apr 4, 2023

Managed to get ours to work with 4.8.1

@rodrigocipriani
Copy link

rodrigocipriani commented Apr 4, 2023

Didn't work here also with 4.8.1.

I've created a very simple example you can replicate.
I've tested with nodejs 18, 16 and 14.

package.json

{
  "name": "prismatest",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "jest --detectOpenHandles"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@prisma/client": "^4.12.0",
    "prisma": "^4.12.0"
  },
  "devDependencies": {
    "@types/jest": "^29.5.0",
    "jest": "^29.5.0",
    "ts-jest": "^29.1.0",
    "typescript": "^5.0.3"
  }
}

`jest.config.js``

/** @type {import('ts-jest').JestConfigWithTsJest} */
module. Exports = {
  preset: "ts-jest",
  testEnvironment: "node",
};

`tsconfig.json``

{
  "compilerOptions": {
    "esModuleInterop": true
  }
}

schema.prisma

datasource db {
    url      = env("DATABASE_URL")
    provider = "postgresql"
}

generator client {
    provider = "prisma-client-js"
}

model User {
    id        Int      @id @default(autoincrement())
    createdAt DateTime @default(now())
    email     String   @unique
    name      String?
}

sum.ts

function sum(a: number, b: number): number {
  return a + b;
}

export default sum;

sum.test.ts

import { PrismaClient } from "@prisma/client";
import sum from "./sum";

const prismaClient = new PrismaClient();

test("adds 1 + 2 to equal 3", () => {
  expect(sum(1, 2)).toBe(3);
});

npm test

➜ prismatest npm test

> prismatest@1.0.0 test
> jest --detectOpenHandles

 PASS  ./sum.test.ts
  ✓ adds 1 + 2 to equal 3 (4 ms)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        1.332 s
Ran all test suites.

Jest has detected the following 1 open handle potentially keeping Jest from exiting:

  ●  CustomGC

      at Runtime._loadModule (node_modules/jest-runtime/build/index.js:1009:29)
      at load (node_modules/@prisma/client/runtime/library.js:73:326)
      at node_modules/@prisma/client/runtime/library.js:73:759
      at runInChildSpan (node_modules/@prisma/client/runtime/library.js:70:25817)
      at qr.loadLibrary (node_modules/@prisma/client/runtime/library.js:73:677)
      at zt.loadEngine (node_modules/@prisma/client/runtime/library.js:101:557)
      at zt.instantiateLibrary (node_modules/@prisma/client/runtime/library.js:100:1477)

EDIT:

With the package.json below, it worked! But with prisma = 3😕

{
  "name": "prismatest",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "jest --detectOpenHandles"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@prisma/client": "^3.15.2",
    "prisma": "^3.15.2"
  },
  "devDependencies": {
    "@types/jest": "^29.5.0",
    "jest": "^29.5.0",
    "ts-jest": "^29.1.0",
    "typescript": "^5.0.3"
  }
}

EDIT 2: 🥲

It seems that with Prisma 3 it didn't work, it stops showing the CustomGC error, but the Memory use is even worse!

@ctsstc
Copy link
Author

ctsstc commented Apr 4, 2023

Thanks for digging in to create a minimum reproduction @rodrigocipriani

With rolling prisma back so far, I have to wonder if this has always been going on for the most part, but maybe Jest updated something that does a better job of catching this problem, so now we've been seeing it.

@rodrigocipriani
Copy link

Thanks for digging in to create a minimum reproduction @rodrigocipriani

With rolling prisma back so far, I have to wonder if this has always been going on for the most part, but maybe Jest updated something that does a better job of catching this problem, so now we've been seeing it.

Maybe you're right, now it's making better job catching problems. But GC still not working, and memory heap size just increases each test. But only when Prisma is "in the game".
Right now I'm not sure that I've tested without Typescript. I I'll get some time tomorrow to test without Typescript.

@gitnlsn
Copy link

gitnlsn commented Apr 5, 2023

I faced the same issue with customGC, preventing jest from exiting. Downgrading to 4.8.1 removed the issue.

My dependencies and devDependencies are the following.

  "dependencies": {
    "@prisma/client": "4.8.1",
    "express": "^4.18.2",
    "zod": "^3.21.4",
    "zod-express-middleware": "^1.4.0"
  },
  "devDependencies": {
    "@types/express": "^4.17.17",
    "@types/jest": "^29.5.0",
    "@types/supertest": "^2.0.12",
    "jest": "^29.5.0",
    "prisma": "4.8.1",
    "supertest": "^6.3.3",
    "ts-jest": "^29.1.0",
    "typescript": "^5.0.3"
  },

@rodrigocipriani
Copy link

4.8.1

Hey, can you send the other files? I've just tested right now with 4.8.1 and still failing.

image

@aravind605
Copy link

@gitnlsn still no luck with 4.8.1 :(

@rodrigocipriani
Copy link

Thanks for digging in to create a minimum reproduction @rodrigocipriani

With rolling prisma back so far, I have to wonder if this has always been going on for the most part, but maybe Jest updated something that does a better job of catching this problem, so now we've been seeing it.

I've just tested without Typescript and still not having CustomGC error. But the Heap size decreased a lot.

image

@rodrigocipriani
Copy link

I've just published it on GitHub for who is interested

https://github.com/rodrigocipriani/prismatest

@gitnlsn
Copy link

gitnlsn commented Apr 10, 2023

I've just published it on GitHub for who is interested

https://github.com/rodrigocipriani/prismatest

I've checked it. Ive cloned it and executed it. I found no issues when running sum.test.*.

But the issue appears when i establish a connection and make a create operation with prisma.

When I downgrade to version 4.8.1. The issue indeed disapppears.

https://github.com/gitnlsn/prisma-test

In this repository there are 2 branches, one for each case. In the readme, I wrote the results from my environment.

Also, I guess the issue might not be related to prisma version at devDependencies, but related to @prisma/client at dependencies. Having "prisma": "^4.8.1", at devDependencies and running npx prisma generate it will install "@prisma/client": "^4.12.0" and the issue will persist.

I hope those information help to debug it.

@rodrigocipriani
Copy link

I've just published it on GitHub for who is interested
https://github.com/rodrigocipriani/prismatest

I've checked it. Ive cloned it and executed it. I found no issues when running sum.test.*.

But the issue appears when i establish a connection and make a create operation with prisma.

When I downgrade to version 4.8.1. The issue indeed disapppears.

https://github.com/gitnlsn/prisma-test

In this repository there are 2 branches, one for each case. In the readme, I wrote the results from my environment.

Also, I guess the issue might not be related to prisma version at devDependencies, but related to @prisma/client at dependencies. Having "prisma": "^4.8.1", at devDependencies and running npx prisma generate it will install "@prisma/client": "^4.12.0" and the issue will persist.

I hope those information help to debug it.

Thanks for the tests. I just realize that I was using "^4.8.1" instead of "4.8.1". So after this I stopped receiving the CustomGC error.
But the thing is that the Garbage collector seems not working yet.

I've created different scenarios to understand the error better. I notice that when you instantiate and use Prisma the heap memory just increases.
You can see those in this PR gitnlsn/prisma-test#1

If you run

npm test --resolveJsonModule ./withPrismaActionsWithoutTypescript/user*

or

npm test --resolveJsonModule ./withPrismaActions/user*

You'll notice that HEAP just increases consistently.

@petrokravets
Copy link

4.8.1 didn't help..
Does anyone have any solution?

@ctsstc
Copy link
Author

ctsstc commented Apr 17, 2023

@janpio What do we need to get the "unconfirmed" label removed? Is there any additional information required? Others have added example repositories as an example for reproduction. Does confirmation need to happen from an internal team?

@janpio
Copy link
Contributor

janpio commented Apr 18, 2023

Yes. If you can confirm using one of the repositories that were posted, let us know - that makes it easier for us.

@aravind605
Copy link

4.8.1 didn't help me either!

@South-Paw
Copy link

South-Paw commented Apr 21, 2023

Downgrading to 4.8.1 worked for me, make sure that you don't keep a ^ in front when downgrading...

{
  "dependencies": {
    "@prisma/client": "4.8.1",
    "prisma": "^4.8.1"
  }
}

However, I have successfully gotten 4.13.0 working as well 🥳

I noted that my integration tests that use the jest --runInBand flag and have a setupFilesAfterEnv script that disconnects after each test didn't have the warnings - I assume it something to do with jest running tests in parallel and prisma not being able to clean up connections properly

// setupFilesAfterEnv script with --runInBand
afterEach(async () => {
  /** After each test, close database connections */
  await prisma.$disconnect();
});

I tried adding this afterEach script to my unit tests without the --runInBand flag and encountered the same problem though.

I ended up resolving it by ensuring things that used/loaded the prisma client were mocked correctly in my unit tests (which... it should of already been but because of some changes I made it wasn't correctly mocked anymore 🙃)

@rodrigocipriani
Copy link

rodrigocipriani commented Apr 24, 2023

The tests I made with:

  • NodeJS 20
  • Prisma 4.13.0
  • on schema.prisma using the new previewFeatures = ["jsonProtocol"]

seems to solve the Heap Memory problem.

I'm not sure if NodeJS <= 18 will solve it, I haven't tested enough
Everything is working with the previewFeature, but I'm afraid of using it in production.

EDIT:

  • I've just tested and with NodeJs 18 we have the same benefits.

@aravind605
Copy link

Prisma 4.13.0 and Prisma 4.13.0 stable versions are released.
Still no luck with jest tests exiting with a failure as mentioned in this comment. :(

Thanks for digging in to create a minimum reproduction @rodrigocipriani
With rolling prisma back so far, I have to wonder if this has always been going on for the most part, but maybe Jest updated something that does a better job of catching this problem, so now we've been seeing it.

I've just tested without Typescript and still not having CustomGC error. But the Heap size decreased a lot.

image

@rodrigocipriani
Copy link

rodrigocipriani commented May 1, 2023

Prisma 4.13.0 and Prisma 4.13.0 stable versions are released.
Still no luck with jest tests exiting with a failure as mentioned in this comment. :(

Thanks for digging in to create a minimum reproduction @rodrigocipriani
With rolling prisma back so far, I have to wonder if this has always been going on for the most part, but maybe Jest updated something that does a better job of catching this problem, so now we've been seeing it.

I've just tested without Typescript and still not having CustomGC error. But the Heap size decreased a lot.

image

Hey @aravind605 ... I didn't try to update this repo to test it. I did it in my other repo and it worked.
Did you try to use the preview feature I cote in this comment?

#18146 (comment)

If I have some time I'll update the test repo you've mentioned.

Let me know if you tested with the jsonProtocol.

@aravind605
Copy link

Prisma 4.13.0 and Prisma 4.13.0 stable versions are released.
Still no luck with jest tests exiting with a failure as mentioned in this comment. :(

Thanks for digging in to create a minimum reproduction @rodrigocipriani
With rolling prisma back so far, I have to wonder if this has always been going on for the most part, but maybe Jest updated something that does a better job of catching this problem, so now we've been seeing it.

I've just tested without Typescript and still not having CustomGC error. But the Heap size decreased a lot.
image

Hey @aravind605 ... I didn't try to update this repo to test it. I did it in my other repo and it worked. Did you try to use the preview feature I cote in this comment?

#18146 (comment)

If I have some time I'll update the test repo you've mentioned.

Let me know if you tested with the jsonProtocol.

It might be due to the previous node modules. once I've cleared and re-installed
Issue is not appearing any more!! Thanks @rodrigocipriani and team prisma!

@rodrigocipriani
Copy link

@aravind605 I'm glad that now it's working for you, thanks for reaching us back.
I will not say that this "bug" is fixed because it's just working with a preview feature, so it's not so safe to use for now.

@kane1997
Copy link

kane1997 commented May 8, 2023

Jest has detected the following 1 open handle potentially keeping Jest from exiting:

● CustomGC

  at Runtime._loadModule (node_modules/jest-runtime/build/index.js:1111:29)
  at DefaultLibraryLoader.loadLibrary (node_modules/@prisma/client/runtime/index.js:24348:29)
  at LibraryEngine.loadEngine (node_modules/@prisma/client/runtime/index.js:24658:24)
  at LibraryEngine.instantiateLibrary (node_modules/@prisma/client/runtime/index.js:24613:5)
  at LibraryEngine.getConfig (node_modules/@prisma/client/runtime/index.js:24822:5)
  at PrismaClient._getActiveProvider (node_modules/@prisma/client/runtime/index.js:32650:30)

same for prisma version 4.9.0

@Jolg42 Jolg42 added bug/2-confirmed Bug has been reproduced and confirmed. and removed bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. labels May 22, 2023
@Jolg42
Copy link
Contributor

Jolg42 commented May 22, 2023

Using #18146 (comment) (which doesn't use the jsonProtocol preview feature)

I could confirm the bug with Prisma versions 4.9.0, 4.10.0, 4.11.0, 4.12.0

Test Suites: 3 passed, 3 total
Tests:       3 passed, 3 total
Snapshots:   0 total
Time:        2.922 s, estimated 6 s
Ran all test suites.

Jest has detected the following 1 open handle potentially keeping Jest from exiting:

  ●  CustomGC

      at Runtime._loadModule (node_modules/jest-runtime/build/index.js:1009:29)
      at load (node_modules/@prisma/client/runtime/library.js:73:326)
      at node_modules/@prisma/client/runtime/library.js:73:759
      at runInChildSpan (node_modules/@prisma/client/runtime/library.js:70:25817)
      at qr.loadLibrary (node_modules/@prisma/client/runtime/library.js:73:677)
      at zt.loadEngine (node_modules/@prisma/client/runtime/library.js:101:557)
      at zt.instantiateLibrary (node_modules/@prisma/client/runtime/library.js:100:1477)
      at zt.start (node_modules/@prisma/client/runtime/library.js:101:2081)
      at zt.getDmmf (node_modules/@prisma/client/runtime/library.js:101:3489)
      at node_modules/@prisma/client/runtime/library.js:177:2864
      at node_modules/@prisma/client/runtime/library.js:177:3294
      at t._executeRequest (node_modules/@prisma/client/runtime/library.js:177:10748)
      at t._request (node_modules/@prisma/client/runtime/library.js:177:10477)

On the good news: I cannot reproduce with 4.13.0 or 4.14.1 so this seems to be fixed already.

Could you try one of these newer version and let us know? I'll close this as fixed now based on the reproduction.

@ctsstc
Copy link
Author

ctsstc commented May 22, 2023

Confirmed on 4.14.1 this does not look to be happening any more 🎉

@MarcusHSmith
Copy link

MarcusHSmith commented Jun 5, 2023

I'm reproducing in 4.15.0

EDIT

upgrading both @prisma/client and prisma to 4.15.0 solved it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. domain/client Issue in the "Client" domain: Prisma Client, Prisma Studio etc. kind/bug A reported bug. topic: jest
Projects
None yet
Development

No branches or pull requests