Skip to content

Commit 2512430

Browse files
jackcclaude
andcommitted
ci: enable parallel testing on the Linux jobs
The comment said parallel testing somehow caused GitHub Actions to kill the runner. The cause was the pgproto3 tests that encode a maximum size (~1GB) message. Under the race detector the shadow memory multiplies that allocation, and running the two tests in parallel peaked at 26.7GB of RSS versus 14.4GB serially. A runner has 16GB, so parallel testing was fatal and serial testing was merely close enough to fail intermittently. Those tests no longer run under the race detector, so the suite now peaks near 1GB whether or not tests run in parallel. Measured on 4 pinned CPUs against PostgreSQL 18, with the race detector: 72s serial versus 26s parallel, with pgconn going from 70.5s to 21.4s and pgxpool from 28.5s to 9.4s. Connections peaked at 48 of max_connections=100, and seven consecutive runs (including three squeezed onto 2 CPUs) were clean. Parallel testing is left disabled on Windows for now. That is the slower runner and the only one that has produced timing sensitive failures, so it is better to let the Linux jobs prove the change first. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 332af64 commit 2512430

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,11 @@ jobs:
115115
git diff --exit-code
116116
117117
- name: Test
118-
# parallel testing is disabled because somehow parallel testing causes Github Actions to kill the runner.
119-
run: go test -parallel=1 -race ./...
118+
# Parallel testing used to kill the runner. The cause was the pgproto3 tests that encode a maximum size (~1GB)
119+
# message: with the race detector's shadow memory they peaked at 27GB of RSS when run in parallel, well past the
120+
# 16GB a runner has. Those tests no longer run under the race detector, and the whole suite now peaks around 1GB
121+
# either way, so parallel testing is enabled again. It cuts this step from ~72s to ~26s.
122+
run: go test -race ./...
120123
env:
121124
PGX_TEST_DATABASE: ${{ matrix.pgx-test-database }}
122125
PGX_TEST_UNIX_SOCKET_CONN_STRING: ${{ matrix.pgx-test-unix-socket-conn-string }}
@@ -162,7 +165,9 @@ jobs:
162165
shell: bash
163166

164167
- name: Test
165-
# Parallel testing is disabled because somehow parallel testing causes Github Actions to kill the runner.
168+
# Parallel testing stays disabled here even though the Linux jobs enable it. This is the slower runner and every
169+
# timing sensitive test failure so far has come from it, so leave it serial until the Linux jobs have proven the
170+
# change.
166171
# Disabling CGO because that is not working on the Windows runner. Apparently, we could install MingW and set up
167172
# CGO to work, but disabling CGO takes less CI time. Without CGO, we also must not use the race detector.
168173
run: go test -parallel=1 ./...

0 commit comments

Comments
 (0)