ci: cap go test -timeout to 90s to bound CI hang impact

Deadlocked tests previously blocked CI for the full 10-minute Go
default before failing. Wave C had a live example: a test timeout
branch using `<-t.Context().Done()` (which never fires until test
return) combined with a dispatch-suppressing patch caused a 10-min
GH Actions stall.

Cap every test binary at 90s. Wave C race-heavy suites run in <20s
locally, so 90s leaves ample breathing room while failing fast on
any future deadlock. Applied to both CI workflow and Makefile so
local `make test` enforces the same bound.

Unit-level defenses (proper `time.After` timeouts in tests) are still
the right fix — this is a safety net, not a substitute.
This commit is contained in:
viettranx committed 2026-04-11 23:17:33 +07:00
1 parent a8b48024fc
commit ee75d498e6
2 files changed
+5 -2

No files matched your search

+4 -1
View File
@@ -21,7 +21,10 @@ jobs:
- run: go build ./...
- run: go build -tags sqliteonly ./...
- run: go vet ./...
- run: go test -race -coverpkg=./... -coverprofile=coverage.out ./...
# -timeout=90s caps each test binary so a deadlocked test fails fast
# instead of blocking CI for the 10-minute default. Race-heavy wave C
# suites run in <20s, so 90s leaves ample breathing room.
- run: go test -race -timeout=90s -coverpkg=./... -coverprofile=coverage.out ./...
- name: Coverage summary
run: go tool cover -func=coverage.out | tail -1
- name: Coverage ratchet gate
+1 -1
View File
@@ -76,7 +76,7 @@ reset: version-file
$(COMPOSE) up -d --build
test:
go test -race ./...
go test -race -timeout=90s ./...
vet:
go vet ./...