fix(ci): serialize integration test packages (-p 1) to stop TRUNCATE deadlocks
First CI integration run proved the act_runner pattern works (service discovery, migrate, exactly-one guard all functioned) but ~150 tests failed with `dbtest.ResetDB truncate: deadlock detected (40P01)` plus cascading FK/dup-key symptoms. Root cause: `go test ./...` runs package binaries concurrently (default -p = NumCPU); every integration package TRUNCATEs the single shared minstrel_test DB, so concurrent truncates deadlock and half-seeded fixtures violate FKs. The documented local invocation is `go test -p 1 ./...` for exactly this reason. Serialize package execution in both the CI step and `make test-integration`. Genuine (non-concurrency) failures will remain after this — never caught before because integration tests never ran in CI. Triaged next. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -17,7 +17,9 @@ test-short:
|
||||
test-integration:
|
||||
docker compose up -d postgres
|
||||
-docker compose exec -T postgres createdb -U minstrel minstrel_test
|
||||
MINSTREL_TEST_DATABASE_URL=postgres://minstrel:minstrel@localhost:5432/minstrel_test?sslmode=disable go test -race ./...
|
||||
# -p 1: integration packages share one test DB and each TRUNCATEs it;
|
||||
# concurrent package binaries deadlock on TRUNCATE. Serialize packages.
|
||||
MINSTREL_TEST_DATABASE_URL=postgres://minstrel:minstrel@localhost:5432/minstrel_test?sslmode=disable go test -p 1 -race ./...
|
||||
|
||||
lint:
|
||||
golangci-lint run ./...
|
||||
|
||||
Reference in New Issue
Block a user