Skip to content

Apache Lucene open-source search software

LUCENE-8853: Temporarily disable random FileSwitchDirectory

Simon Willnauere6a9bfb8b27a
diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
index e5159a784e3..cd8d492ca6f 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
@@ -91,7 +91,6 @@ import org.apache.lucene.store.ByteBuffersDirectory;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.FSDirectory;
import org.apache.lucene.store.FSLockFactory;
-import org.apache.lucene.store.FileSwitchDirectory;
import org.apache.lucene.store.FlushInfo;
import org.apache.lucene.store.IOContext;
import org.apache.lucene.store.LockFactory;
@@ -1415,13 +1414,14 @@ public abstract class LuceneTestCase extends Assert {
}
Directory fsdir = newFSDirectoryImpl(clazz, f, lf);
- if (rarely()) {
- List<String> fileExtensions =
- Arrays.asList("fdt", "fdx", "tim", "tip", "si", "fnm", "pos", "dii", "dim", "nvm", "nvd", "dvm", "dvd");
- Collections.shuffle(fileExtensions, random());
- fileExtensions = fileExtensions.subList(0, 1 + random().nextInt(fileExtensions.size()));
- fsdir = new FileSwitchDirectory(new HashSet<>(fileExtensions), fsdir, newFSDirectoryImpl(clazz, f, lf), true);
- }
+// LUCENE-8853: FileSwitchDirectory is broken for tmp outputs.
+// if (rarely()) {
+// List<String> fileExtensions =
+// Arrays.asList("fdt", "fdx", "tim", "tip", "si", "fnm", "pos", "dii", "dim", "nvm", "nvd", "dvm", "dvd");
+// Collections.shuffle(fileExtensions, random());
+// fileExtensions = fileExtensions.subList(0, 1 + random().nextInt(fileExtensions.size()));
+// fsdir = new FileSwitchDirectory(new HashSet<>(fileExtensions), fsdir, newFSDirectoryImpl(clazz, f, lf), true);
+// }
BaseDirectoryWrapper wrapped = wrapDirectory(random(), fsdir, bare);
return wrapped;
} catch (Exception e) {