You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by si...@apache.org on 2019/03/21 13:20:49 UTC

[lucene-solr] branch master updated: Add assume to test since it only works with mmap directory

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

simonw pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/master by this push:
     new 65e1b3e  Add assume to test since it only works with mmap directory
65e1b3e is described below

commit 65e1b3ef2a6bc986ddf12a831fa6450f8aca36a0
Author: Simon Willnauer <si...@apache.org>
AuthorDate: Thu Mar 21 14:20:23 2019 +0100

    Add assume to test since it only works with mmap directory
---
 .../org/apache/lucene/codecs/lucene50/TestBlockPostingsFormat.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lucene/core/src/test/org/apache/lucene/codecs/lucene50/TestBlockPostingsFormat.java b/lucene/core/src/test/org/apache/lucene/codecs/lucene50/TestBlockPostingsFormat.java
index 094415b..9d2d5b8 100644
--- a/lucene/core/src/test/org/apache/lucene/codecs/lucene50/TestBlockPostingsFormat.java
+++ b/lucene/core/src/test/org/apache/lucene/codecs/lucene50/TestBlockPostingsFormat.java
@@ -40,6 +40,7 @@ import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.store.ByteArrayDataInput;
 import org.apache.lucene.store.Directory;
+import org.apache.lucene.store.FSDirectory;
 import org.apache.lucene.store.IOContext;
 import org.apache.lucene.store.IndexInput;
 import org.apache.lucene.store.IndexOutput;
@@ -60,7 +61,8 @@ public class TestBlockPostingsFormat extends BasePostingsFormatTestCase {
 
   public void testFstOffHeap() throws IOException {
     Path tempDir = createTempDir();
-    try (Directory d = MMapDirectory.open(tempDir)) {
+    try (Directory d = FSDirectory.open(tempDir)) {
+      assumeTrue("only works with mmap directory", d instanceof MMapDirectory);
       try (IndexWriter w = new IndexWriter(d, new IndexWriterConfig(new MockAnalyzer(random())))) {
         DirectoryReader readerFromWriter = DirectoryReader.open(w);
         for (int i = 0; i < 50; i++) {