You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2021/05/05 10:43:00 UTC

[jena] branch main updated: JENA-2096: Skip mmap file check on MS Windows

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

andy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git


The following commit(s) were added to refs/heads/main by this push:
     new 248731a  JENA-2096: Skip mmap file check on MS Windows
248731a is described below

commit 248731a0543d93901e70452da7a14ababc10770a
Author: Andy Seaborne <an...@apache.org>
AuthorDate: Wed May 5 11:42:52 2021 +0100

    JENA-2096: Skip mmap file check on MS Windows
---
 .../src/test/java/org/apache/jena/tdb2/sys/TestDatabaseOps.java  | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/sys/TestDatabaseOps.java b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/sys/TestDatabaseOps.java
index 72987d0..089399d 100644
--- a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/sys/TestDatabaseOps.java
+++ b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/sys/TestDatabaseOps.java
@@ -19,9 +19,11 @@
 package org.apache.jena.tdb2.sys;
 
 import static org.junit.Assert.*;
+import static org.junit.Assume.assumeFalse;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.jena.atlas.lib.FileOps;
+import org.apache.jena.base.Sys;
 import org.apache.jena.dboe.base.file.Location;
 import org.apache.jena.graph.Graph;
 import org.apache.jena.graph.Triple;
@@ -195,6 +197,7 @@ public class TestDatabaseOps
     }
 
     @Test public void compact_delete() {
+        assumeFalse(Sys.isWindows);
         DatasetGraph dsg = DatabaseMgr.connectDatasetGraph(dir);
         DatasetGraphSwitchable dsgs = (DatasetGraphSwitchable)dsg;
         DatasetGraph dsg1 = dsgs.get();
@@ -206,7 +209,11 @@ public class TestDatabaseOps
         });
         DatabaseMgr.compact(dsg, true);
 
-        assertFalse(IOX.asFile(loc1).exists());
+        // Memory mapped files do not go away on MS Windows until the JVM exits.
+        // This is a long standing JDK issue.
+        // https://bugs.openjdk.java.net/browse/JDK-4715154
+        if ( ! Sys.isWindows )
+            assertFalse(IOX.asFile(loc1).exists());
 
         DatasetGraph dsg2 = dsgs.get();
         Location loc2 = ((DatasetGraphTDB)dsg2).getLocation();