prisma-engines
prisma-engines copied to clipboard
Make Query Engine tests faster on CockroachDB
It's almost an hour right now in the CI. Somebody said creating schemas on CockroachDB is much slower than creating databases, so maybe now when we have our own provider for CDB, we could try if creating databases for every test would make more sense and we could get that test runtime under 30 minutes again.
(Let's also ask the Cockroach ppl again, maybe we are missing obvious stuff.) (Which reminds me that they told us to use a memory disk via a startup parameter in the past - I think we never actually got that to work. We should try again.)
We have one idea to test:
- Change creating a new schema to creating a new database. This may make it faster.
Change creating a new schema to creating a new database. This may make it faster.
This is going to be a requirement for multi-schema tests, and that is coming soon, so you could deal with the two problems in one go.
As a data point, the introspection and migration test suites do one-database-per test and they are slow, but not by an integer multiple of the postgres test times.
Next steps:
- Read answers from CDB team
- Find out if anything is actionable
In a private project we run prisma+CRDB and switched to creating Databases based on their documentation. This didn't result in faster DBs.
We were using db push to init each database but we suspect that db push has a slowness due to how prisma queries the existing schema on the running database (even a fresh database).
@davedash That might be related to https://github.com/cockroachdb/cockroach/issues/108781 (or related, we are not sure if we found all of them), which also affects pretty empty databases - but less bad.