You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TestDryRunPreflight/servfail flakes under load: 200ms timeout vs resolver retry #235
TestDryRunPreflight/servfail fails intermittently under full-suite load: the preflight is classified as timeout instead of error.
Where
main_dryrun_test.go:70-86 (TestDryRunPreflight, the servfail case runs with -timeout 200)
Details
The test's server answers SERVFAIL, and the comment in the test notes that Go's stub resolver may retry a SERVFAIL itself. With a 200 ms lookup timeout, those retries can run past the deadline when the machine is busy, and the outcome becomes a timeout:
Seen once in a local go test ./... on Windows. go test -count=10 -run TestDryRunPreflight . passes 10/10 in isolation.
Impact
A spurious red run, mostly on loaded machines and CI runners. The dry-run behavior itself is correct: the run still fails (exit 1, PreflightOK=false).
Suggested fix
Give the servfail case a timeout that leaves room for the stub resolver's own retry, for example -timeout 2000 (the server answers at once, so the test stays fast). Alternatively, accept timeout as well as error there, since both mean a failed preflight. The first option keeps the assertion sharp.
Acceptance criteria
go test -count=50 -run TestDryRunPreflight . passes while another go test ./... runs alongside
Getting started
Relevant files: main_dryrun_test.go
How to run tests: go test -run TestDryRunPreflight .
Filed by repo-audit/fix-issues at d256b7d. Severity: low. Effort: S. audit-key: testing|main_dryrun_test.go|TestDryRunPreflight
Fixed in ddb10c1: the servfail case now runs with -timeout 2000. The server answers at once, so this only gives Go's stub resolver room for its own SERVFAIL retry, and the assertion stays on error.
Verified: go test -count=30 -run TestDryRunPreflight . passes with the scan and dns test packages running alongside, and CI is green on every job at 76c0174.
Activity
TMHSDigital commentedon Nov 13, 2026
Fixed in ddb10c1: the
servfailcase now runs with-timeout 2000. The server answers at once, so this only gives Go's stub resolver room for its own SERVFAIL retry, and the assertion stays onerror.Verified:
go test -count=30 -run TestDryRunPreflight .passes with thescananddnstest packages running alongside, and CI is green on every job at 76c0174.