Skip to content

Commit

Permalink
dnsforward: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
ainar-g committed Oct 2, 2024
1 parent 355cec1 commit ce743a3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/dnsforward/dnsforward_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,13 @@ func TestSafeSearch(t *testing.T) {
req := createTestMessage(tc.host)

var reply *dns.Msg

// Use a mutex, since require.Eventually uses goroutines.
mu := &sync.Mutex{}
require.Eventually(t, func() (ok bool) {
mu.Lock()
defer mu.Unlock()

reply, _, err = client.Exchange(req, addr)

return err == nil
Expand Down

0 comments on commit ce743a3

Please sign in to comment.