From cd06ab16ac94e4b6e598b455fdcc402183746fc4 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Tue, 8 Jan 2019 19:20:53 +1100 Subject: [PATCH] tracker: Fix network error handling in unit test --- tracker/udp_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tracker/udp_test.go b/tracker/udp_test.go index 5b12bc6b..3a22aee2 100644 --- a/tracker/udp_test.go +++ b/tracker/udp_test.go @@ -15,6 +15,7 @@ import ( "github.com/anacrolix/dht/krpc" _ "github.com/anacrolix/envpprof" + "github.com/pkg/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -141,7 +142,7 @@ func TestUDPTracker(t *testing.T) { Request: req, }.Do() // Skip any net errors as we don't control the server. - if _, ok := err.(net.Error); ok { + if _, ok := errors.Cause(err).(net.Error); ok { t.Skip(err) } require.NoError(t, err) -- 2.48.1