Skip to content

Commit

Permalink
contrib/miekg/dns: resolve flaky test in TestExchange* (#3045)
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahkm committed Dec 19, 2024
1 parent a36a57f commit d1e90d7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions contrib/miekg/dns/dns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func startServer(t *testing.T, traced bool) (*dns.Server, func()) {
if traced {
h = dnstrace.WrapHandler(h)
}
addr := getFreeAddr(t).String()
addr := getAddr(t).String()
server := &dns.Server{
Addr: addr,
Net: "udp",
Expand Down Expand Up @@ -190,8 +190,8 @@ func assertClientSpan(t *testing.T, s *mocktracer.Span) {
assert.Equal(t, ext.SpanKindClient, s.Tag(ext.SpanKind))
}

func getFreeAddr(t *testing.T) net.Addr {
li, err := net.Listen("tcp", "127.0.0.1:0")
func getAddr(t *testing.T) net.Addr {
li, err := net.Listen("tcp4", "127.0.0.1:2020")
if err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit d1e90d7

Please sign in to comment.