1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-10 05:52:20 +08:00

address comments from CR

This commit is contained in:
Jeromy
2015-04-03 15:37:14 -07:00
parent 76e879c9e0
commit 8450a8d4d8
4 changed files with 24 additions and 10 deletions

View File

@ -105,10 +105,15 @@ func TestPeerRepeats(t *testing.T) {
// Now, if one of the tasks gets finished, the next task off the queue should
// be for the same peer
tasks[0].Done()
for blockI := 0; blockI < 4; blockI++ {
for i := 0; i < 4; i++ {
// its okay to mark the same task done multiple times here (JUST FOR TESTING)
tasks[i].Done()
ntask := prq.Pop()
if ntask.Target != tasks[0].Target {
t.Fatal("Expected task from peer with lowest active count")
ntask := prq.Pop()
if ntask.Target != tasks[i].Target {
t.Fatal("Expected task from peer with lowest active count")
}
}
}
}