rmuir commented on code in PR #14627:
URL: https://github.com/apache/lucene/pull/14627#discussion_r2079522011


##########
lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/WindowsFS.java:
##########
@@ -58,7 +58,13 @@ private Object getKey(Path existing) throws IOException {
     BasicFileAttributeView view =
         Files.getFileAttributeView(existing, BasicFileAttributeView.class);
     BasicFileAttributes attributes = view.readAttributes();
-    return attributes.fileKey();
+    Object key = attributes.fileKey();
+    if (key != null) {
+      return key;
+    }
+    // the key may be null, e.g. on real Windows!
+    // in that case we fallback to the real path
+    return existing.toRealPath();

Review Comment:
   We don't need to test for theoretical situations such as symlinks when we 
dont use them in lucene? So I would go with the fastest/simplest route, that 
solves our needs.
   
   Its not a generic windows filesystem simulator, just good enough for our 
needs, to prevent deleting open files and test the logic surrounding that.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to