You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ce...@apache.org on 2023/03/10 08:08:23 UTC

svn commit: r1908242 - /poi/trunk/poi/src/test/java/org/apache/poi/util/TestIOUtils.java

Author: centic
Date: Fri Mar 10 08:08:23 2023
New Revision: 1908242

URL: http://svn.apache.org/viewvc?rev=1908242&view=rev
Log:
Fix a flaky test which fails roughly once in 9000 iterations

Ranodm(9000) means it can also be 0 so the test should allow reading 300 bytes only

Modified:
    poi/trunk/poi/src/test/java/org/apache/poi/util/TestIOUtils.java

Modified: poi/trunk/poi/src/test/java/org/apache/poi/util/TestIOUtils.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/test/java/org/apache/poi/util/TestIOUtils.java?rev=1908242&r1=1908241&r2=1908242&view=diff
==============================================================================
--- poi/trunk/poi/src/test/java/org/apache/poi/util/TestIOUtils.java (original)
+++ poi/trunk/poi/src/test/java/org/apache/poi/util/TestIOUtils.java Fri Mar 10 08:08:23 2023
@@ -322,7 +322,8 @@ final class TestIOUtils {
             len = IOUtils.toByteArray(is, 90, 100).length;
             assertEquals(90, len);
             len = IOUtils.toByteArray(is, Integer.MAX_VALUE, Integer.MAX_VALUE).length;
-            assertTrue(len > 300-2*90);
+            assertTrue(len >= 300-2*90,
+                    "Had: " + len + " when reading file " + TMP + " with size " + TMP.length());
         }
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org