Commit fcda24a
authored
Remove all Prisma Optimize examples (#8514)
* Remove all Prisma Optimize examples
Prisma Optimize is being discontinued. This removes the entire
optimize/ directory (6 example projects) and the corresponding
section from the root README.
* Fix CI flaky tests by giving each dev server a unique name
The concurrent tests all called startPrismaDevServer() with the default
name "default" in stateless mode. On slow CI runners, multiple tests
would scan for servers simultaneously, find none, and all try to bind
the same port (51216), causing EADDRINUSE failures.
Passing a unique name per test lets the port allocator see other
servers and pick distinct ports.
* Fix EADDRINUSE by assigning explicit unique ports per test
The previous approach of using unique names didn't work because
stateless mode never writes server state to disk, so concurrent
tests still race on the same default port range.
Instead, assign each test its own set of 3 ports (server, database,
shadow database) from a counter starting at 52000. Since all tests
in a file share a single Node.js event loop, the synchronous counter
increment is atomic against concurrent async calls.
* Fix CI EADDRINUSE: use singleFork and unique ports per test
With singleFork: false, vitest distributes concurrent tests across
separate worker processes. Each worker re-imports the module, resetting
the port counter, so multiple workers race on the same ports.
Setting singleFork: true ensures all tests in a file share one process,
making the portOffset counter effective. Combined with explicit unique
ports per test (starting at 52000, 3 ports each), concurrent tests
never collide.
* Add debug logging for port assignment in CI
* Fix CI: run tests sequentially to avoid @prisma/dev port conflicts
@prisma/dev internally allocates ports beyond the 3 user-configurable
ones (port, databasePort, shadowDatabasePort). When many PGLite
instances start concurrently, they race on these internal ports
(51216+), causing EADDRINUSE.
Run tests sequentially (maxConcurrency: 1, remove describe.concurrent)
to ensure only one @prisma/dev server runs at a time. This is slower
(~4min vs ~1min per test file) but eliminates the flaky port conflicts
that have been failing CI consistently.1 parent 8cb4291 commit fcda24a
105 files changed
Lines changed: 6 additions & 2296 deletions
File tree
- optimize
- optimize-excessive-rows
- images
- prisma
- utils
- optimize-full-table-scan
- images
- prisma
- utils
- optimize-repeated-query
- images
- prisma
- utils
- optimize-select-returning-all
- images
- prisma
- utils
- optimize-unindexed-column
- images
- prisma
- utils
- starter
- packages
- client
- public
- src
- assets
- components
- lib
- server
- prisma
- src
- lib
- router
- tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | 121 | | |
132 | 122 | | |
133 | 123 | | |
| |||
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Binary file not shown.
This file was deleted.
This file was deleted.
Lines changed: 0 additions & 24 deletions
This file was deleted.
This file was deleted.
0 commit comments