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
TestPoolBenchesDeadResolver is flaky (about 7% failure rate) #253
good first issueGood for newcomersseverity: mediumEdge-case bugs, degraded behavior, meaningful maintenance costtestingTest coverage and test infrastructure
TestPoolBenchesDeadResolver is flaky. Run alone with -count=40 it failed 3 times (about 7.5%), and it also failed once in a full go test ./... run.
Where
internal/scan/pool_test.go:186-215
internal/scan/runner.go:631-641 (preflight against the trusted resolver)
Details
There are two failure modes:
The preflight against the trusted resolver times out (resolver 127.0.0.1:NNNNN failed preflight ... timeout after 2 attempt(s)). The test sets Timeout to 50 ms with Attempts: 2, which a busy loopback server can miss.
The stats.NXDomain != 80 assertion fails with Timeout:1..5, because both attempts for a name can land on the dead member before it is benched.
Impact
CI runs this test on Ubuntu (with -race), macOS and Windows without retries, so it causes false red builds. It is the same class of problem as #234 and #235.
Steps to reproduce
go test -count=40 -run TestPoolBenchesDeadResolver ./internal/scan/
Suggested fix
Give the trusted resolver and the preflight a generous timeout (at least 250 ms) while keeping the dead member's 50 ms. Or assert NXDomain + Timeout == 80 with a small timeout ceiling. Keep the assertions that the dead member gets benched and receives no more than 40 lookups.
Acceptance criteria
-count=200 passes locally on Windows and Linux.
Getting started
Relevant files: internal/scan/pool_test.go
How to run tests: go test -count=200 -run TestPoolBenchesDeadResolver ./internal/scan/
Fixed in 7d18b44: the test's per-lookup timeout (trusted preflight and pool) goes from 50ms to 250ms. Verified with go test -count=60 -run TestPoolBenchesDeadResolver ./internal/scan/: 60/60 pass (about 1.5s per run); 500ms also passed 60/60 but doubled the runtime.
good first issueGood for newcomersseverity: mediumEdge-case bugs, degraded behavior, meaningful maintenance costtestingTest coverage and test infrastructure
Activity
TMHSDigital commentedon Nov 14, 2026
Fixed in 7d18b44: the test's per-lookup timeout (trusted preflight and pool) goes from 50ms to 250ms. Verified with go test -count=60 -run TestPoolBenchesDeadResolver ./internal/scan/: 60/60 pass (about 1.5s per run); 500ms also passed 60/60 but doubled the runtime.