tracker/udp_test.go | 17 +++++++---------- diff --git a/tracker/udp_test.go b/tracker/udp_test.go index f080621f1675e6575c7248e533c78c28f3608898..1c06407168a41d3992c2656ac5597029b2d90077 100644 --- a/tracker/udp_test.go +++ b/tracker/udp_test.go @@ -18,6 +18,11 @@ "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) +var trackers = []string{ + "udp://tracker.coppersurfer.tk:6969", + "udp://tracker.leechers-paradise.org:6969", +} + // Ensure net.IPs are stored big-endian, to match the way they're read from // the wire. func TestNetIPv4Bytes(t *testing.T) { @@ -127,7 +132,7 @@ NumWant: -1, } rand.Read(req.PeerId[:]) copy(req.InfoHash[:], []uint8{0xa3, 0x56, 0x41, 0x43, 0x74, 0x23, 0xe6, 0x26, 0xd9, 0x38, 0x25, 0x4a, 0x6b, 0x80, 0x49, 0x10, 0xa6, 0x67, 0xa, 0xc1}) - ar, err := Announce(defaultClient, defaultHTTPUserAgent, "udp://tracker.openbittorrent.com:80/announce", &req) + ar, err := Announce(defaultClient, defaultHTTPUserAgent, trackers[0], &req) // Skip any net errors as we don't control the server. if _, ok := err.(net.Error); ok { t.Skip(err) @@ -151,15 +156,7 @@ rand.Read(req.InfoHash[:]) wg := sync.WaitGroup{} success := make(chan bool) fail := make(chan struct{}) - for _, url := range []string{ - "udp://tracker.openbittorrent.com:80/announce", - "udp://tracker.publicbt.com:80", - "udp://tracker.istole.it:6969", - "udp://tracker.ccc.de:80", - "udp://tracker.open.demonii.com:1337", - "udp://open.demonii.com:1337", - "udp://exodus.desync.com:6969", - } { + for _, url := range trackers { wg.Add(1) go func(url string) { defer wg.Done()