The resolver tests in internal/resolver/resolver_test.go use NewFromLogger which creates real UDP/TCP DNS clients. All tests run in parallel hitting real nameservers, which causes:
Slow: Test suite takes >30s, violating CI time constraints
Racy: Data race detected under -race flag due to concurrent real DNS queries
Flaky: Tests fail intermittently depending on network conditions and DNS server availability
Solution
Replace real DNS calls with a mock DNSClient using the existing NewFromLoggerWithClient(log, client DNSClient) constructor. All test behaviors (NS lookup, A/AAAA/MX/TXT records, NXDOMAIN, sorting, dedup, context cancellation, trailing dots, etc.) should be preserved but use deterministic canned responses instead of real network calls.
## Problem
The resolver tests in `internal/resolver/resolver_test.go` use `NewFromLogger` which creates real UDP/TCP DNS clients. All tests run in parallel hitting real nameservers, which causes:
1. **Slow**: Test suite takes >30s, violating CI time constraints
2. **Racy**: Data race detected under `-race` flag due to concurrent real DNS queries
3. **Flaky**: Tests fail intermittently depending on network conditions and DNS server availability
## Solution
Replace real DNS calls with a mock `DNSClient` using the existing `NewFromLoggerWithClient(log, client DNSClient)` constructor. All test behaviors (NS lookup, A/AAAA/MX/TXT records, NXDOMAIN, sorting, dedup, context cancellation, trailing dots, etc.) should be preserved but use deterministic canned responses instead of real network calls.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
The resolver tests in
internal/resolver/resolver_test.gouseNewFromLoggerwhich creates real UDP/TCP DNS clients. All tests run in parallel hitting real nameservers, which causes:-raceflag due to concurrent real DNS queriesSolution
Replace real DNS calls with a mock
DNSClientusing the existingNewFromLoggerWithClient(log, client DNSClient)constructor. All test behaviors (NS lookup, A/AAAA/MX/TXT records, NXDOMAIN, sorting, dedup, context cancellation, trailing dots, etc.) should be preserved but use deterministic canned responses instead of real network calls.