mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-28 15:43:10 +00:00
fix(test): keep int gate under Postgres connection ceiling
Cap vitest workers and raise Docker max_connections so high-core laptops stop failing the suite with cascading "too many clients" / QueryError noise.
This commit is contained in:
parent
3c6b3c4b4c
commit
1a3084a6ee
2 changed files with 12 additions and 3 deletions
|
|
@ -13,6 +13,10 @@ services:
|
||||||
POSTGRES_DB: teqo
|
POSTGRES_DB: teqo
|
||||||
ports:
|
ports:
|
||||||
- '5432:5432'
|
- '5432:5432'
|
||||||
|
# Default max_connections=100 is tight for vitest forks (≈CPUs × pg pool)
|
||||||
|
# plus a leftover `next start` from local repro. Raise the ceiling so the
|
||||||
|
# int gate fails on real assertions, not "too many clients already".
|
||||||
|
command: ['postgres', '-c', 'max_connections=200']
|
||||||
volumes:
|
volumes:
|
||||||
- pgdata:/var/lib/postgresql/data
|
- pgdata:/var/lib/postgresql/data
|
||||||
# Runs only on first initialization of the volume. Creates the dedicated
|
# Runs only on first initialization of the volume. Creates the dedicated
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,14 @@ export default defineConfig({
|
||||||
environment: 'jsdom',
|
environment: 'jsdom',
|
||||||
setupFiles: ['./vitest.setup.ts'],
|
setupFiles: ['./vitest.setup.ts'],
|
||||||
include: ['tests/int/**/*.int.spec.ts'],
|
include: ['tests/int/**/*.int.spec.ts'],
|
||||||
// Int specs hit a real Postgres under a ~48-way parallel suite, so wall
|
// Cap forks so each worker's Payload pg pool stays under Docker Postgres
|
||||||
// time is dominated by pool contention, not by the code under test. The
|
// max_connections=100 on high-core laptops (default worker count ≈ CPUs;
|
||||||
// 5s default made legitimately heavy RSC-composition tests flake as the
|
// 16× pool-max-10 ≈ 160 clients → "too many clients already", which then
|
||||||
|
// cascades into unrelated QueryError noise). CI runners have fewer CPUs.
|
||||||
|
maxWorkers: 8,
|
||||||
|
// Int specs hit a real Postgres under a parallel suite, so wall time is
|
||||||
|
// dominated by pool contention, not by the code under test. The 5s
|
||||||
|
// default made legitimately heavy RSC-composition tests flake as the
|
||||||
// suite grew (municipalityPageData was the first); one global budget
|
// suite grew (municipalityPageData was the first); one global budget
|
||||||
// beats per-test overrides. Genuinely hung tests still fail — just 10s
|
// beats per-test overrides. Genuinely hung tests still fail — just 10s
|
||||||
// later. The unit suite keeps the 5s default.
|
// later. The unit suite keeps the 5s default.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue