Skip to content

Commit d731559

Browse files
committed
Make the test more lenient with timing.
1 parent e734b30 commit d731559

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/test/java/org/apache/commons/io/input/ReadAheadInputStreamTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ void testClosePlusExecutorService() throws IOException {
9696
try (ReadAheadInputStream rais = ReadAheadInputStream.builder().setInputStream(inputStream).setExecutorService(externalExecutor).get()) {
9797
assertEquals('1', rais.read());
9898
}
99+
Thread.yield();
99100
// The underlying FileInputStream should be closed since ReadAheadInputStream is a FilterInputStream.
101+
assertThrows(IOException.class, inputStream::available);
100102
assertThrows(IOException.class, inputStream::read);
101103
// The caller remains responsible for shutting down the executor.
102104
} finally {

0 commit comments

Comments
 (0)