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

export default vitestConfig.realPg({
  test: {
    // Real-PG suites (record-redemption / secaudit) spin an embedded-postgres
    // server per test file. Default forks pool (maxForks = cpus-1) would start
    // several initdb processes 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. Bounds the pool (gate-concurrency-deflake).
    poolOptions: { forks: { singleFork: true } },
  },
})
