Skip to content

Commit

Permalink
don't continue on read / write error in stream suite (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann authored Apr 26, 2022
1 parent 4a572e7 commit c130e6e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions p2p/transport/testsuite/stream_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func SubtestStress(t *testing.T, ta, tb transport.Transport, maddr ma.Multiaddr,
bufs <- buf
if _, err := s.Write(buf); err != nil {
t.Errorf("s.Write(buf): %s", err)
continue
return
}
}
}
Expand All @@ -154,10 +154,11 @@ func SubtestStress(t *testing.T, ta, tb transport.Transport, maddr ma.Multiaddr,

if _, err := io.ReadFull(s, buf2); err != nil {
t.Errorf("io.ReadFull(s, buf2): %s", err)
continue
return
}
if !bytes.Equal(buf1, buf2) {
t.Errorf("buffers not equal (%x != %x)", buf1[:3], buf2[:3])
return
}
}
}
Expand Down

0 comments on commit c130e6e

Please sign in to comment.