Skip to content

TestDryRunPreflight/servfail flakes under load: 200ms timeout vs resolver retry #235

Closed

Description

@TMHSDigital

Summary

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:

--- FAIL: TestDryRunPreflight/servfail (0.23s)
    main_dryrun_test.go:85: plans = [{... Preflight:timeout PreflightOK:false}], want preflight "error" ok=false

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

Activity

  1. added
    good first issue
    testing
    severity: low
    on Nov 13, 2026
  2. TMHSDigital commented on Nov 13, 2026

    @TMHSDigital
    OwnerAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueseverity: lowtesting

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions