Skip to content

Commit

Permalink
Merge pull request etcd-io#16268 from fuweid/fix-TestPageWriterRandom
Browse files Browse the repository at this point in the history
pkg/ioutil: deflake TestPageWriterRandom
  • Loading branch information
ahrtr authored Jul 19, 2023
2 parents 35628b9 + fddd1ad commit 92de641
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/ioutil/pagewriter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ func TestPageWriterRandom(t *testing.T) {
if cw.writeBytes > n {
t.Fatalf("wrote %d bytes to io.Writer, but only wrote %d bytes", cw.writeBytes, n)
}
if n-cw.writeBytes > pageBytes {
t.Fatalf("got %d bytes pending, expected less than %d bytes", n-cw.writeBytes, pageBytes)
if maxPendingBytes := pageBytes + defaultBufferBytes; n-cw.writeBytes > maxPendingBytes {
t.Fatalf("got %d bytes pending, expected less than %d bytes", n-cw.writeBytes, maxPendingBytes)
}
t.Logf("total writes: %d", cw.writes)
t.Logf("total write bytes: %d (of %d)", cw.writeBytes, n)
Expand Down

0 comments on commit 92de641

Please sign in to comment.