ci: drop redundant MySQL service container #11

Merged
zombor merged 1 commit from ci-drop-mysql-service into main 2026-05-20 18:13:48 +00:00
Owner

Problem

When two CI runs land concurrently on the runner, the second one fails at "Set up job" with:

Bind for 0.0.0.0:3307 failed: port is already allocated

This was blocking every concurrent PR (first seen on PR #10, commit 5f1261ba).

Root cause

The MySQL service container in both the test and coverage jobs bound port 3307:3306 on the runner host — a static allocation that only one job can hold at a time. The container was dead weight:

  • internal/db/db_test.go uses testcontainers-go to spin up its own MySQL 8 instance per test run
  • No test code reads the BOOKSHELF_DSN env var the workflow set

Fix

Remove the services: block and the BOOKSHELF_DSN env var from both the test and coverage jobs. Tests continue to get a real MySQL database via testcontainers — nothing changes for test behaviour, only the port contention goes away.

## Problem When two CI runs land concurrently on the runner, the second one fails at \"Set up job\" with: ``` Bind for 0.0.0.0:3307 failed: port is already allocated ``` This was blocking every concurrent PR (first seen on PR #10, commit 5f1261ba). ## Root cause The MySQL service container in both the `test` and `coverage` jobs bound port `3307:3306` on the runner host — a static allocation that only one job can hold at a time. The container was dead weight: - `internal/db/db_test.go` uses `testcontainers-go` to spin up its own MySQL 8 instance per test run - No test code reads the `BOOKSHELF_DSN` env var the workflow set ## Fix Remove the `services:` block and the `BOOKSHELF_DSN` env var from both the `test` and `coverage` jobs. Tests continue to get a real MySQL database via testcontainers — nothing changes for test behaviour, only the port contention goes away.
ci: drop redundant MySQL service container
All checks were successful
/ Lint (pull_request) Successful in 1m19s
/ Test (pull_request) Successful in 1m22s
/ Coverage (pull_request) Successful in 1m6s
86675f1b9a
The service container bound port 3307:3306 on the runner host, causing
"port is already allocated" failures when two CI runs executed
concurrently (seen on PR #10, commit 5f1261ba).

The container was never needed: db_test.go uses testcontainers-go to
spin up its own MySQL 8 instance per test run, and no test code reads
the BOOKSHELF_DSN env var the workflow set. Removing the service block
eliminates the port contention entirely without changing how tests
obtain a real MySQL database.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
zombor force-pushed ci-drop-mysql-service from 86675f1b9a
All checks were successful
/ Lint (pull_request) Successful in 1m19s
/ Test (pull_request) Successful in 1m22s
/ Coverage (pull_request) Successful in 1m6s
to e9f78d0842
All checks were successful
/ Lint (pull_request) Successful in 1m8s
/ Test (pull_request) Successful in 1m15s
/ Coverage (pull_request) Successful in 59s
2026-05-20 18:11:13 +00:00
Compare
zombor merged commit 29f64368bb into main 2026-05-20 18:13:48 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
zombor/pergamum!11
No description provided.