fix: skip real-DNS resolver tests in make check, add timeout
All checks were successful
Check / check (pull_request) Successful in 10m9s
All checks were successful
Check / check (pull_request) Successful in 10m9s
Resolver tests perform iterative DNS resolution from root nameservers, which can hang indefinitely. This broke make check on main. Changes: - Add -short and -timeout 30s flags to go test in make check - Skip real-DNS integration tests when -short is set (via testContext helper) - Context-canceled tests still run (no network needed) - Also add -timeout 30s to make test target Run integration tests explicitly with: go test -v -race ./internal/resolver/...
This commit is contained in:
@@ -34,8 +34,12 @@ func newTestResolver(t *testing.T) *resolver.Resolver {
|
||||
func testContext(t *testing.T) context.Context {
|
||||
t.Helper()
|
||||
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test requiring real DNS")
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithTimeout(
|
||||
context.Background(), 60*time.Second,
|
||||
context.Background(), 15*time.Second,
|
||||
)
|
||||
t.Cleanup(cancel)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user