Description and expected behavior
zen push db creates a temporal file named ~schema.prisma. Running that command in parallel cause a race condition.
Simulation
$ echo `line 1` > zenstack/~schema.prisma # Process 1
$ zen db push # Process 2
$ echo `line 2` >> zenstack/~schema.prisma # Process 1
$ cat zenstack/~schema.prisma
The output is:
The expected output was:
Environment (please complete the following information):
- ZenStack version: 3.4.6
- Database type: PostgreSQL
- Node.js/Bun version: v22.17.1
- Package manager: yarn
Additional context
We run parallel tests with parallel containers for the databases. But the test runner itself is running in the same single shell, so it causes the race condition.