Skip to content

Commit ddb10c1

Browse files
TMHSDigitalclaude
andcommitted
test(dryrun): give the SERVFAIL preflight case room for resolver retries (#235)
TestDryRunPreflight/servfail ran with -timeout 200. Go's stub resolver retries a SERVFAIL itself, and on a loaded machine that retry could outlast 200 ms, so the preflight read as a timeout instead of an error. The test server answers at once, so a 2 s timeout costs nothing and keeps the assertion on "error". Verified: go test -count=30 -run TestDryRunPreflight . passes while the scan and dns test packages run alongside. Fixes #235 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 33ca905 commit ddb10c1

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎main_dryrun_test.go‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ func TestDryRunPreflight(t *testing.T) {
7676
t.Fatal(err)
7777
}
7878
defer srv.Close()
79-
code, plans := dryRunPlans(t, "-dns-server", srv.Addr, "-timeout", "200", "-attempts", "1",
79+
// The server answers at once; the timeout only has to cover the
80+
// stub resolver's own SERVFAIL retry, even on a loaded machine
81+
// (#235).
82+
code, plans := dryRunPlans(t, "-dns-server", srv.Addr, "-timeout", "2000", "-attempts", "1",
8083
"-type", "A", "-w", wl, "example.com")
8184
if code != tc.code {
8285
t.Errorf("exit %d, want %d", code, tc.code)

0 commit comments

Comments
 (0)