mirror of https://github.com/apache/lucene.git
LUCENE-5303: clear cache before each test
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1535215 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3a594688a5
commit
6455445730
|
@ -100,7 +100,7 @@ public class OrdinalsCache {
|
|||
// reference. When it's no longer referenced, the entire inner map can be
|
||||
// evicted.
|
||||
private static final Map<Object,Map<String,CachedOrds>> ordsCache = new WeakHashMap<Object,Map<String,CachedOrds>>();
|
||||
|
||||
|
||||
/**
|
||||
* Returns the {@link CachedOrds} relevant to the given
|
||||
* {@link AtomicReaderContext}, or {@code null} if there is no
|
||||
|
@ -141,4 +141,9 @@ public class OrdinalsCache {
|
|||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
/** Clears all entries from the cache. */
|
||||
public synchronized static void clear() {
|
||||
ordsCache.clear();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,7 +72,9 @@ public class OrdinalsCacheTest extends FacetTestCase {
|
|||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
OrdinalsCache.clear();
|
||||
|
||||
long ramBytesUsed = 0;
|
||||
for (Thread t : threads) {
|
||||
t.start();
|
||||
|
|
Loading…
Reference in New Issue