Repository navigation
Conversation
The timeout case counted packets the test server received. On a loaded machine an attempt's 100 ms can expire before its packet is written, so the server saw one query although the probe was retried. Count the queries the client dials with WithQueryCounter instead. Closes TMHSDigital#439
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
TestCheckWildcardInconclusive/timeoutcounted the packets that the test server received. With a 100 ms per-attempt timeout, an attempt on a loaded machine can expire before its packet is written. The server then sees one query even though the probe was retried. The test now counts queries on the client side with the existingWithQueryCounterhook, whichNewResolver's Dial increments once per query it dials (retries included), and asserts that count is at least 2. Production code is unchanged.Related Issue
Closes #439
Type of Change
Checklist
Ethical Considerations
Additional Information
Tested on Linux with Go 1.27:
go test -cpu 1 -count=20 -run TestCheckWildcardInconclusive ./internal/dnspasses whilego test ./... -count=3runs in parallel.go test ./...andgo vet ./internal/dnsare clean.Attempts: 1temporarily. The timeout case then fails withqueries dialed = 1, want >= 2.I did not reproduce the original Windows flake.
This change was prepared with AI assistance and reviewed before submission.