tracker/udp: Triage errors in tests to real hosts
This commit is contained in:
parent
e4a0493bd0
commit
ae28507f30
|
@ -105,6 +105,7 @@ func TestUDPTracker(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Create a fake UDP tracker to make these requests to.
|
||||||
func TestAnnounceRandomInfoHash(t *testing.T) {
|
func TestAnnounceRandomInfoHash(t *testing.T) {
|
||||||
wg := sync.WaitGroup{}
|
wg := sync.WaitGroup{}
|
||||||
for _, url := range []string{
|
for _, url := range []string{
|
||||||
|
@ -131,7 +132,8 @@ func TestAnnounceRandomInfoHash(t *testing.T) {
|
||||||
rand.Read(req.InfoHash[:])
|
rand.Read(req.InfoHash[:])
|
||||||
resp, err := tr.Announce(&req)
|
resp, err := tr.Announce(&req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Logf("error announcing to %s: %s", url, err)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
if resp.Leechers != 0 || resp.Seeders != 0 || len(resp.Peers) != 0 {
|
if resp.Leechers != 0 || resp.Seeders != 0 || len(resp.Peers) != 0 {
|
||||||
t.Fatal(resp)
|
t.Fatal(resp)
|
||||||
|
|
Loading…
Reference in New Issue