8224480: (fc) java/nio/channels/FileChannel/MapTest.java fails intermittently

Brian Burkhalter brian.burkhalter at oracle.com
Fri Jun 28 21:46:20 UTC 2019


https://bugs.openjdk.java.net/browse/JDK-8224480

The failures reported in this issue were all in the recently added MapTest.testForce() method. This method currently performs 12,800 invocations of MappedByteBuffer.force(int,int). On Unix, force() calls msync(2) to flush the in-memory data to the file system. The machines on which the failures occurred were determined to be two 2012 vintage Mac Pros and a Mac Mini of similar vintage, all running HDDs, 5400 RPM on the Mini, 7200 RPM on the Pros. The hypothesis is that these configurations could be too slow for this sub-test so this patch proposes to halve the number of iterations in testForce() to account for this. An alternative would be to change testForce() to be a separate test.

Thanks,

Brian

--- a/test/jdk/java/nio/channels/FileChannel/MapTest.java
+++ b/test/jdk/java/nio/channels/FileChannel/MapTest.java
@@ -195,7 +195,7 @@
      * the data exercising various valid and invalid writeback ranges.
      */
     private static void testForce() throws Exception {
-        for (int x=0; x<100; x++) {
+        for (int x=0; x<50; x++) {
             try (RandomAccessFile raf = new RandomAccessFile(blah, "rw")) {
                 FileChannel fc = raf.getChannel();
                 final int BLOCK_SIZE = 64;

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20190628/55a2f592/attachment.html>


More information about the nio-dev mailing list