mirror of https://github.com/apache/lucene.git
LUCENE-6271: fix another test bug (happens in nightly more often) unrelated to this branch
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene6271@1670525 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
10565e237d
commit
87b3bfaee4
|
@ -28,6 +28,7 @@ import java.util.HashSet;
|
|||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
@ -957,12 +958,18 @@ public class TestLRUQueryCache extends LuceneTestCase {
|
|||
BadQuery query = new BadQuery();
|
||||
searcher.count(query);
|
||||
query.i[0] += 1; // change the hashCode!
|
||||
|
||||
try {
|
||||
// trigger an eviction
|
||||
searcher.count(new MatchAllDocsQuery());
|
||||
fail();
|
||||
} catch (ConcurrentModificationException e) {
|
||||
// expected
|
||||
} catch (RuntimeException e) {
|
||||
// expected: wrapped when executor is in use
|
||||
Throwable cause = e.getCause();
|
||||
assertTrue(cause instanceof ExecutionException);
|
||||
assertTrue(cause.getCause() instanceof ConcurrentModificationException);
|
||||
}
|
||||
|
||||
IOUtils.close(w, reader, dir);
|
||||
|
|
Loading…
Reference in New Issue