You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2026/04/05 13:17:56 UTC

(commons-io) branch master updated: Make the test more lenient with timing.

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-io.git


The following commit(s) were added to refs/heads/master by this push:
     new d731559a8 Make the test more lenient with timing.
d731559a8 is described below

commit d731559a8e341385c9511a0e13e95c50f81cf60d
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Apr 5 09:17:50 2026 -0400

    Make the test more lenient with timing.
---
 src/test/java/org/apache/commons/io/input/ReadAheadInputStreamTest.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/test/java/org/apache/commons/io/input/ReadAheadInputStreamTest.java b/src/test/java/org/apache/commons/io/input/ReadAheadInputStreamTest.java
index 1a2520ba4..d121e3c48 100644
--- a/src/test/java/org/apache/commons/io/input/ReadAheadInputStreamTest.java
+++ b/src/test/java/org/apache/commons/io/input/ReadAheadInputStreamTest.java
@@ -96,7 +96,9 @@ void testClosePlusExecutorService() throws IOException {
                 try (ReadAheadInputStream rais = ReadAheadInputStream.builder().setInputStream(inputStream).setExecutorService(externalExecutor).get()) {
                     assertEquals('1', rais.read());
                 }
+                Thread.yield();
                 // The underlying FileInputStream should be closed since ReadAheadInputStream is a FilterInputStream.
+                assertThrows(IOException.class, inputStream::available);
                 assertThrows(IOException.class, inputStream::read);
                 // The caller remains responsible for shutting down the executor.
             } finally {