Is anyone else doing integration testing using Pri...
# orm-help
j
Is anyone else doing integration testing using Prisma (or any sort of test where you are using the live prisma client)? I’m finding that it often gets overwhelmed with connections. Also when I call
prisma.$disconnect()
it’s taking around 30 seconds to a minute.
r
I'm doing integration testing on a Postgres database inside Docker, through Prisma why are you explicitly calling $disconnect?
j
I’m getting handing threads otherwise.
I basically have a similar setup, although with MySQL.
When I do not disconnect, the tests finish in a reasonable time, but I get this at the end:
Copy code
munmap_chunk(): invalid pointer
munmap_chunk(): invalid pointer
munmap_chunk(): invalid pointer
munmap_chunk(): invalid pointer
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 --detectOpenHandles to find leaks. Active timers can also cause this, ensure that .unref() was called on them.
How many test suites do you have?
we have around 100, averaging about 10 tests per suite.
r
10 suites, 358 tests
but I don't $connect or $disconnect explicitly
j
It’s got to be related to transactions… 😕
I seem to be running to issues around 600-700 tests. 😞
r
I'm around 90% through a sequelize -> prisma migration, and to be fair a lot of the transaction code hasn't been migrated yet to prisma, so I have yet to run into any issues with those
j
We’re running our tests in transactions so that we can roll back at the end of the test
r
I see, I'm doing a database reset at the start of the run, so it rebuilds the database everytime
even if the test fails or runs into issues, the next run will have a fresh start, doesn't rely on rollbacks