Skip to content

Apache Lucene open-source search software

don't wrap already-atomic readers in crazy hierarchies while Uwe is visiting relatives

Robert Muirbde0264a26fd
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 11692dbc195..1d4d301d4b3 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
@@ -1351,6 +1351,13 @@ public abstract class LuceneTestCase extends Assert {
public static IndexReader maybeWrapReader(IndexReader r) throws IOException {
// TODO: remove this, and fix those tests to wrap before putting slow around:
final boolean wasOriginallyAtomic = r instanceof AtomicReader;
+
+ if (wasOriginallyAtomic) {
+ // TODO: investigate purging etc of tests making top-level fieldcaches,
+ // something is up if they get a crazy hierarchy
+ return r;
+ }
+
if (rarely()) {
for (int i = 0, c = random.nextInt(6)+1; i < c; i++) {
switch(random.nextInt(4)) {