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

Cleaning prisma query engine after tests #326

Merged
merged 3 commits into from
Apr 8, 2021

Conversation

LeChatErrant
Copy link
Owner

@LeChatErrant LeChatErrant commented Apr 8, 2021

Context

Jest launches one subprocess per test suites
To this is added one other subprocess, the globalSetup

Each of those subprocesses does not correctly clear Prisma query engine, so they stay as orphan processes

Solution

This PR move the setup logic into the beforeAll hook of Jest, located directly inside test suites, so the globalSetup is not anymore needed

Since the database is instanciated from inside test suites, it enables calling prisma.$disconnect in the afterAll hook of Jest

@LeChatErrant LeChatErrant added the bug Something isn't working label Apr 8, 2021
@LeChatErrant LeChatErrant self-assigned this Apr 8, 2021
@LeChatErrant LeChatErrant linked an issue Apr 8, 2021 that may be closed by this pull request
@LeChatErrant LeChatErrant merged commit b8c9bf5 into master Apr 8, 2021
@LeChatErrant LeChatErrant deleted the prisma-engine-cleaning branch April 8, 2021 19:59
@github-actions
Copy link

github-actions bot commented Apr 8, 2021

Congratulations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prisma engine not terminated after integration
1 participant