swarm/network/stream: removed REPEAT retry loop

This commit is contained in:
Fabio Barone 2019-05-10 08:30:51 -05:00
parent f8518d26c6
commit 25831b3bf2

View file

@ -274,8 +274,6 @@ func runPureRetrievalTest(nodeCount int, chunkCount int) error {
log.Debug("starting retrieval")
cnt := 0
REPEAT:
for {
for _, id := range nodeIDs {
item, ok := sim.NodeItem(id, bucketKeyFileStore)
if !ok {
@ -302,17 +300,12 @@ func runPureRetrievalTest(nodeCount int, chunkCount int) error {
ok = false
}
if !ok {
time.Sleep(500 * time.Millisecond)
// we continue trying if it failed
continue REPEAT
return fmt.Errorf("Expected test to succeed at first run, but failed with chunk not found")
}
log.Debug(fmt.Sprintf("chunk with root hash %x successfully retrieved", chunk.Address()))
cnt++
}
}
// we iterate sequentially, one after the other, so at this point we got all chunks
break
}
log.Info("retrieval terminated, chunks retrieved: ", "count", cnt)
return nil