Repository navigation
Description
Summary
Three tests depend on wall-clock timing and fail under load: TestPoolSpreadsLoad, TestE2ELabs/lab2_-force_filters_the_wildcard and TestE2ESARIF. All pass in isolation. A full coverage-instrumented run on a quiet workstation reproduced all three failures.
Where
internal/scan/pool_test.go:36-64(TestPoolSpreadsLoad, asserts a 3x wall-clock ratio)main_lab_test.go:39-42, 54-71, 175-179(lab E2E cases use the CLI default-timeout 1000)main.go:179(default timeout),.github/workflows/go.yml:70(CI runs the full suite with-race)
Details
TestPoolSpreadsLoad failed with "20 resolvers took 642ms, 1 took 1.30s; want at least 3x faster". Lab 2 returned all 30 words instead of 3: the wildcard fingerprint probe timed out, so -force continued without a fingerprint (runner.go:508-515) and everything was reported. Only one lab case passes an explicit -timeout (main_lab_test.go:84). The lab tests talk to an in-process UDP dnsserver, so a 1 s timeout is generous on an idle machine and insufficient under -race plus coverage on a busy CI runner.
Impact
Red CI on slow runners masks real regressions. The lab 2 failure mode (everything reported) is exactly the regression that test exists to catch, so a flaky version trains people to re-run instead of read.
Suggested fix
- Pass
-timeout 5000 -attempts 3in everyTestE2ELabs,TestE2ESARIFandTestE2ELabTakeoverHintinvocation (or via the shared helper) - Lab 2
-force: also assert the notice stream does not contain "wildcard detection failed", so a timeout-induced pass-through fails with a clear message -
TestPoolSpreadsLoad: replace the wall-clock ratio with a deterministic observable (max concurrent in-flight queries per resolver as seen by the handler); keep the timing version as aBenchmark - Add
-shuffle=onto the CIgo testinvocation and run the suite twice locally under-racewithGOMAXPROCS=2before closing
Acceptance criteria
-
go test -race -count=5 ./...passes withGOMAXPROCS=2 - No test asserts on elapsed time
Getting started
- Relevant files:
internal/scan/pool_test.go,main_lab_test.go,main_e2e_test.go - How to run tests:
go test -race -count=3 ./internal/scan/ . - Related docs:
docs/CONTRIBUTING.mdtesting section
Filed by repo-audit/full-audit at 3139c44. Severity: high. Effort: S. audit-key: testing|internal/scan/pool_test.go|flaky timing
Activity
TMHSDigital commentedon Nov 9, 2026
Fixed in 1f8c657.
TestE2ELabs,TestE2ESARIF,TestE2ELabTakeoverHint) pass-timeout 5000 -attempts 3;TestE2ELabsfails with a clear message if the wildcard probe timed out.TestPoolSpreadsLoadchecks lookups per pool member (all 20 used, none above a quarter) instead of wall-clock ratios; the timing comparison is nowBenchmarkPoolSpreadsLoad.go test -race -shuffle=on.Verified:
GOMAXPROCS=2 go test -race -count=3over the lab, SARIF and pool tests passes, and the full suite passes (also twice with-shuffle=on). The only shuffled failure seen locally was the Windows port-pair bind bug, #204, which is a separate cause.A few tests still have upper-bound elapsed-time checks outside this issue's three (rate limiter, cancelled-context resolver, dnsserver). Those are tracked separately.
TMHSDigital commentedon Nov 9, 2026
The remaining upper-bound timing checks mentioned above are tracked in #206.