swarm/network/stream: address PR comments

This commit is contained in:
Fabio Barone 2018-10-03 17:22:36 -05:00
parent d1457c7b3c
commit 11948b04ea
2 changed files with 10 additions and 14 deletions

View file

@ -220,9 +220,8 @@ func runFileRetrievalTest(nodeCount int) error {
log.Warn("Retrieve error", "err", err, "hash", hash, "nodeId", id)
time.Sleep(500 * time.Millisecond)
continue REPEAT
} else {
log.Debug(fmt.Sprintf("File with root hash %x successfully retrieved", hash))
}
log.Debug(fmt.Sprintf("File with root hash %x successfully retrieved", hash))
}
}
return nil
@ -312,9 +311,8 @@ func runRetrievalTest(chunkCount int, nodeCount int) error {
log.Warn("Retrieve error", "err", err, "hash", hash, "nodeId", id, "size", s)
time.Sleep(500 * time.Millisecond)
continue REPEAT
} else {
log.Debug(fmt.Sprintf("Chunk with root hash %x successfully retrieved", hash))
}
log.Debug(fmt.Sprintf("Chunk with root hash %x successfully retrieved", hash))
}
}
// all nodes and files found, exit loop and return without error

View file

@ -313,15 +313,14 @@ func runSim(conf *synctestConfig, ctx context.Context, sim *simulation.Simulatio
// Do not get crazy with logging the warn message
time.Sleep(500 * time.Millisecond)
continue REPEAT
} else {
evt := &simulations.Event{
Type: EventTypeChunkArrived,
Node: sim.Net.GetNode(id),
Data: chunk.String(),
}
sim.Net.Events().Send(evt)
log.Debug(fmt.Sprintf("Chunk %s IS FOUND for id %s", chunk, id))
}
evt := &simulations.Event{
Type: EventTypeChunkArrived,
Node: sim.Net.GetNode(id),
Data: chunk.String(),
}
sim.Net.Events().Send(evt)
log.Debug(fmt.Sprintf("Chunk %s IS FOUND for id %s", chunk, id))
}
}
return nil
@ -515,9 +514,8 @@ func testSyncingViaDirectSubscribe(t *testing.T, chunkCount int, nodeCount int)
// Do not get crazy with logging the warn message
time.Sleep(500 * time.Millisecond)
continue REPEAT
} else {
log.Debug(fmt.Sprintf("Chunk %s IS FOUND for id %s", chunk, id))
}
log.Debug(fmt.Sprintf("Chunk %s IS FOUND for id %s", chunk, id))
}
}
return nil