Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions internal/dns/ratelimit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ func TestRateLimiterNoUnderDelivery(t *testing.T) {
if elapsed < ideal*8/10 {
t.Errorf("finished in %s, faster than the rate allows (ideal %s)", elapsed, ideal)
}
if elapsed > ideal*15/10+100*time.Millisecond {
t.Errorf("finished in %s, well below the configured rate (ideal %s)", elapsed, ideal)
if elapsed > ideal*5 {
t.Errorf("finished in %s, far beyond a hang-only ceiling (ideal %s)", elapsed, ideal)
}
}

Expand Down
6 changes: 2 additions & 4 deletions internal/dns/resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,13 @@ func TestResolveDomainWithRetryContextCancellation(t *testing.T) {
cancel()

timeout := time.Second
start := time.Now()
_, result := ResolveDomainWithRetry(ctx, srv.Resolver(timeout), "example.com.", timeout, nil, 5, []string{"A"})
elapsed := time.Since(start)

if result == OutcomeFound {
t.Errorf("expected cancelled context to prevent resolution")
}
if elapsed > 500*time.Millisecond {
t.Errorf("expected near-instant return on cancelled context, took %s", elapsed)
if srv.Queries() != 0 {
t.Errorf("expected no query to reach the server on cancelled context, got %d", srv.Queries())
}
}

Expand Down
2 changes: 1 addition & 1 deletion internal/dnsserver/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func TestCloseWaitsForHandlers(t *testing.T) {
if running.Load() != finished.Load() {
t.Errorf("Close returned with %d handlers still running", running.Load()-finished.Load())
}
if took := time.Since(start); took > 2*time.Second {
if took := time.Since(start); took > 10*time.Second {
t.Errorf("Close took %s; a parked stream connection held it", took)
}
}
Expand Down