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

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1291999 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2012-02-21 20:44:16 +00:00
parent d3a7d32385
commit bde0264a26
1 changed files with 7 additions and 0 deletions

View File

@ -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)) {