Skip to content

Commit

Permalink
internal/dns: update TestDNSResolver_ExponentialBackoff to not return…
Browse files Browse the repository at this point in the history
… error before last resolution attempt
  • Loading branch information
purnesh42H committed Feb 3, 2025
1 parent 7dbf12e commit 1ba51b7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions internal/resolver/dns/dns_resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -626,13 +626,17 @@ func (s) TestDNSResolver_ExponentialBackoff(t *testing.T) {
}
}

if i == retries-1 {
// Update resolver.ClientConn to not return an error
// anymore before last resolution retry to ensure that
// last resolution attempt doesn't back off.
returnNilErr.Store(true)
}

// Unblock the DNS resolver's backoff by pushing the current time.
timeChan <- time.Now()
}

// Update resolver.ClientConn to not return an error anymore.
returnNilErr.Store(true)

// Unblock the DNS resolver's backoff, if ongoing, while we set the
// test clientConn to not return an error anymore.
select {
Expand Down

0 comments on commit 1ba51b7

Please sign in to comment.