mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-30 01:52:26 +08:00
swarm test: reporting errors fix
This commit is contained in:
@ -139,7 +139,10 @@ func SubtestSwarm(t *testing.T, SwarmNum int, MsgNum int) {
|
|||||||
for k := 0; k < MsgNum; k++ { // with k messages
|
for k := 0; k < MsgNum; k++ { // with k messages
|
||||||
msg := "ping"
|
msg := "ping"
|
||||||
log.Debugf("%s %s %s (%d)", s1.local, msg, p, k)
|
log.Debugf("%s %s %s (%d)", s1.local, msg, p, k)
|
||||||
stream.Write([]byte(msg))
|
if _, err := stream.Write([]byte(msg)); err != nil {
|
||||||
|
errChan <- err
|
||||||
|
continue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// read it later
|
// read it later
|
||||||
@ -200,7 +203,7 @@ func SubtestSwarm(t *testing.T, SwarmNum int, MsgNum int) {
|
|||||||
// check any errors (blocks till consumer is done)
|
// check any errors (blocks till consumer is done)
|
||||||
for err := range errChan {
|
for err := range errChan {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err.Error())
|
t.Error(err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user