tracker/udp: Triage errors in tests to real hosts

This commit is contained in:
Matt Joiner 2014-11-20 16:24:49 -06:00
parent e4a0493bd0
commit ae28507f30
1 changed files with 3 additions and 1 deletions

View File

@ -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)