import { vitestConfig } from '@tooling/vitest-config'

export default vitestConfig.realPg({
  test: {
    // Real-PG concurrency suites spin an embedded-postgres server per test file.
    // Default forks pool (maxForks = cpus-1) starts several initdb at once and,
    // multiplied across DB packages under `turbo --concurrency=N`, storms the box
    // → a starved worker flakes (even a no-DB jsdom suite). singleFork serialises
    // this package's files → at most ONE embedded-postgres alive at a time here,
    // capping total concurrent postgres at the turbo concurrency (gate-concurrency-deflake).
    poolOptions: { forks: { singleFork: true } },
  },
})
