Go test failures — FAIL / panic: test timed out
Log signatures
--- FAIL: TestName FAIL github.com/you/pkg 0.42s undefined: SomeIdentifier panic: test timed out after 10m0s
What’s happening
Go's signatures are terse and precise. FAIL\t (FAIL + tab) is the per-package failure line — FAIL github.com/you/pkg 0.42s. "undefined:" is a compile error inside test scope: tests failed to build, often because a test file references an identifier renamed in the main code, or a build tag excluded the file that defines it — nothing actually ran. "panic: test timed out" is Go's 10-minute default test binary timeout: either a genuine deadlock (the panic includes a full goroutine dump — read it, the stuck goroutine is in there) or a suite that legitimately outgrew the limit.
Fix playbook
- 1Rerun only the failing package and test: go test ./pkg/... -run 'TestName' -v.
- 2undefined:: treat as a compile fix. Check build tags (//go:build) if the identifier clearly exists — the file defining it may be excluded for this OS/arch.
- 3panic: test timed out: read the goroutine dump at the bottom of the log. Goroutines blocked on a channel/mutex for the full duration name the deadlock. If it's genuinely slow, raise -timeout consciously.
- 4Race-flavored flakiness: rerun with -race -count=10. A test that fails intermittently under -count=10 has a real concurrency bug, not "CI weirdness."
- 5Fix the narrowest site and rerun the package before ./....
Prevention
- Run go test -race in CI always. The race detector converts intermittent heisenbugs into deterministic failures with stack traces.
Triage every red build, not just this one.
This page is one of 31 failure classes the open-source patchrail CLI matches from a raw log — locally, with secrets redacted first. If a log stumps it, open an issue; if it saves you a debugging morning, a star helps other maintainers find it.
pipx install patchrail