Skip to content

Commit fcda24a

Browse files
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

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

β€ŽREADME.mdβ€Ž

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -118,16 +118,6 @@ The [`accelerate`](./accelerate) folder contains examples of projects using [Pri
118118
| [`nuxt-starter`](./accelerate/nuxtjs-starter/) | A Nuxt.js project using Prisma Accelerate's caching and connection pooling |
119119
| [`astro-starter`](./accelerate/astro-starter/) | An Astro project using Prisma Accelerate's caching and connection pooling |
120120

121-
## Prisma Optimize
122-
123-
The [`optimize`](./optimize) folder contains examples of projects using [Prisma Optimize](https://www.prisma.io/data-platform/optimize) to identify and improve the performance of slow queries.
124-
| Demo | Description |
125-
| ------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
126-
| [`starter`](./optimize/starter) | A Prisma Optimize starter app |
127-
| [`optimize-excessive-rows`](./optimize/optimize-excessive-rows) | An example app demonstrating the "Excessive number of rows returned" recommendation provided by Optimize. |
128-
| [`optimize-full-table-scan`](./optimize/optimize-full-table-scan) | An example app demonstrating the "Full table scans caused by `LIKE` operations" recommendation provided by Optimize. |
129-
| [`optimize-unindexed-column`](./optimize/optimize-unindexed-column) | An example app demonstrating the "Query filtering on an unindexed column" recommendation provided by Optimize. |
130-
131121
## Deployment platforms
132122

133123
The projects in the [`deployment-platforms`](./deployment-platforms) directory show what "Prisma Client"-based deployment setups look like for various deployment providers. Learn more about [deployment](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/deployment) in the Prisma documentation.

β€Žoptimize/optimize-excessive-rows/.env.exampleβ€Ž

Lines changed: 0 additions & 2 deletions
This file was deleted.

β€Žoptimize/optimize-excessive-rows/.gitignoreβ€Ž

Lines changed: 0 additions & 5 deletions
This file was deleted.

β€Žoptimize/optimize-excessive-rows/README.mdβ€Ž

Lines changed: 0 additions & 115 deletions
This file was deleted.

β€Žoptimize/optimize-excessive-rows/environment.d.tsβ€Ž

Lines changed: 0 additions & 10 deletions
This file was deleted.
Binary file not shown.

β€Žoptimize/optimize-excessive-rows/package.jsonβ€Ž

Lines changed: 0 additions & 21 deletions
This file was deleted.

β€Žoptimize/optimize-excessive-rows/prisma.config.tsβ€Ž

Lines changed: 0 additions & 13 deletions
This file was deleted.

β€Žoptimize/optimize-excessive-rows/prisma/schema.prismaβ€Ž

Lines changed: 0 additions & 24 deletions
This file was deleted.

β€Žoptimize/optimize-excessive-rows/prisma/seed.tsβ€Ž

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
Β (0)