Repository navigation
Description
Summary
TestPoolOfLiarsFallsBackToTrusted gives both resolvers a 1 s timeout and a single attempt, then asserts exact counts. Under full-suite load, one late loopback answer is enough to fail it.
Where
internal/scan/retry_edges_test.go:154-168internal/scan/runner.go:723-743(resolveViaPoolreturns the trusted lookup's failure outcome as is)
Details
// Timeout: time.Second, Attempts: 1 on both the lying member and the trusted resolver
if st.Found != 1 || st.NXDomain != int64(len(entries)-1) {A local full-suite run (go test -count=1 -coverpkg=./... ./...) failed with found 1 nxdomain 19; want only www… after 1.06 s. A passing run takes about 50 ms, so one name used up the whole per-query budget. The failure message prints only Found and NXDomain, so it does not say which outcome the missing name got.
Impact
Occasional red builds on a loaded runner. CI's Linux leg runs this package with -race and -coverpkg, which is slower still. This is the same class as the closed timeout flakes #289 and #235.
Steps to reproduce
Seen once in two local full-suite runs (Windows, go1.26.11). Not reproduced in isolation: go test -count=40 -run 'TestPoolOfLiarsFallsBackToTrusted$' ./internal/scan/ passed every time.
Suggested fix
Give both resolvers headroom: Attempts: 2, or a 3 s timeout on dns.NewResolver, dns.NewPool and Config.Timeout. Add st.Timeout, st.Other and st.Unconfirmed to the failure message.
Acceptance criteria
- The test tolerates one slow loopback answer
- The failure message names the outcome of the missing names
Getting started
- Relevant files:
internal/scan/retry_edges_test.go - How to run tests:
go test ./internal/scan/ -run TestPoolOfLiarsFallsBackToTrusted -count=20 - Related: End-to-end tests fail intermittently under load: short DNS timeouts in parallel tests #289, TestDryRunPreflight/servfail flakes under load: 200ms timeout vs resolver retry #235
Filed by repo-audit/full-audit at dd5b156. Severity: low. Effort: S. audit-key: testing|internal/scan/retry_edges_test.go|TestPoolOfLiarsFallsBackToTrusted
Activity
TMHSDigital commentedon Nov 18, 2026
Fixed in fc64cbf. The test now uses a 3s timeout on the trusted resolver, the pool and
Config.Timeout, and two attempts, and its failure message also prints the timeout, other and unconfirmed counts.Verified:
go test -count=30andgo test -race -count=3of the test pass locally, as does the full scan package; CI green.