Skip to content

Commit ad361d1

Browse files
committed
test: AvailableTest: Don't assume InputStream.available is exact
InputStream.available is returning an estimate only, so don't fail if the numbers are off (seen on Linux)
1 parent 2d84684 commit ad361d1

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

junixsocket-common/src/test/java/org/newsclub/net/unix/AvailableTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ private void receiveBytes(final Socket sock, final int expected) throws IOExcept
6363
// it's kind of OK but since available() is an estimate, but come on...
6464
return;
6565
}
66-
assertEquals(toExpect, available);
66+
67+
// NOTE: in.available() returns just an estimate,
68+
// which can be lower, or higher (as seen on Linux)
69+
// assertEquals(toExpect, available);
70+
6771
final byte[] buf = new byte[expected];
6872
final int numRead = in.read(buf);
6973
assertEquals(toExpect, numRead);

0 commit comments

Comments
 (0)