Browse Source

chore(ci): give the race job a 25m test timeout

The race job failed with "panic: test timed out after 10m0s" in
internal/web/service (FAIL at 600.106s) while every other package passed
and the non-race go-test job ran the same package in 57s.

Nothing hung. The race detector costs this repo ~8.5-10x (internal/database
8.4s -> 73s, internal/sub 17.8s -> 149s), and internal/web/service has 671
tests, ~40 of which each pay a full InitDB + AutoMigrate. That puts it right
on go test's 10-minute default per-package timeout: the last four race jobs
finished in 10m10s-10m28s before this one crossed the line.

Pass -timeout 25m in ci.yml and `make race` so the largest package has real
headroom while a genuine deadlock is still bounded. Verified locally:
ok internal/web/service 265.425s, 658 tests, no data races.
Sanaei 3 hours ago
parent
commit
13e87a18c8
2 changed files with 4 additions and 2 deletions
  1. 2 1
      .github/workflows/ci.yml
  2. 2 1
      Makefile

+ 2 - 1
.github/workflows/ci.yml

@@ -138,7 +138,8 @@ jobs:
       - name: Race + shuffle
       - name: Race + shuffle
         run: |
         run: |
           go list ./... | grep -v '/frontend/node_modules/' > /tmp/go-packages.txt
           go list ./... | grep -v '/frontend/node_modules/' > /tmp/go-packages.txt
-          go test -race -shuffle=on -count=1 $(cat /tmp/go-packages.txt)
+          # internal/web/service runs ~10x slower under -race and overruns the 10m default.
+          go test -race -shuffle=on -count=1 -timeout 25m $(cat /tmp/go-packages.txt)
 
 
   # Brief native-fuzz smoke on the security-/parser-critical decoders. Each runs the
   # Brief native-fuzz smoke on the security-/parser-critical decoders. Each runs the
   # generated corpus plus 30s of exploration; a crash here is a real input-handling bug.
   # generated corpus plus 30s of exploration; a crash here is a real input-handling bug.

+ 2 - 1
Makefile

@@ -54,8 +54,9 @@ test-go: dist-stub ## Go tests (shuffle, no cache)
 	go test -shuffle=on -count=1 $(GO_PKGS)
 	go test -shuffle=on -count=1 $(GO_PKGS)
 
 
 .PHONY: race
 .PHONY: race
+# internal/web/service runs ~10x slower under -race and overruns go test's 10m default.
 race: dist-stub ## Go tests with the race detector (needs a C compiler)
 race: dist-stub ## Go tests with the race detector (needs a C compiler)
-	go test -race -shuffle=on -count=1 $(GO_PKGS)
+	go test -race -shuffle=on -count=1 -timeout 25m $(GO_PKGS)
 
 
 .PHONY: test-fe
 .PHONY: test-fe
 test-fe: ## Frontend tests (vitest)
 test-fe: ## Frontend tests (vitest)