-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
21 lines (21 loc) · 931 Bytes
/
Copy pathdocker-compose.yml
File metadata and controls
21 lines (21 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
services:
postgres:
image: postgres:16
# `-n auto` gives one xdist worker per core, each holding several connections, and more than
# one worktree runs a suite against this container at a time. Measured on a 12-core machine:
# one suite alone peaks at 105 concurrent connections and averages 68, against the postgres
# default of 100. Over the ceiling the failure is a psycopg.OperationalError on connect, which
# lands on whichever database-touching test was running -- so it moves between runs and reads
# as a flaky test rather than as exhausted connections. Two of us lost hours to that today.
command: ["postgres", "-c", "max_connections=300"]
environment:
POSTGRES_USER: sync
POSTGRES_PASSWORD: sync
POSTGRES_DB: sync
ports:
- "5433:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U sync"]
interval: 2s
timeout: 3s
retries: 15