mirror of
https://github.com/apache/lucene.git
synced 2025-03-04 07:19:18 +00:00
Make test not so expensive nightly (we want to test only our ref cleanup functionality not concurrency of the backingMap)
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1221195 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f42b2ffd63
commit
4dc3278d0d
@ -113,7 +113,8 @@ public class TestWeakIdentityMap extends LuceneTestCase {
|
||||
}
|
||||
|
||||
public void testConcurrentHashMap() throws Exception {
|
||||
final int threadCount = atLeast(32), keyCount = atLeast(1024);
|
||||
// don't make threadCount and keyCount random, otherwise easily OOMs or fails otherwise:
|
||||
final int threadCount = 8, keyCount = 1024;
|
||||
final ExecutorService exec = Executors.newFixedThreadPool(threadCount);
|
||||
final WeakIdentityMap<Object,Integer> map =
|
||||
WeakIdentityMap.newConcurrentHashMap();
|
||||
@ -127,9 +128,9 @@ public class TestWeakIdentityMap extends LuceneTestCase {
|
||||
try {
|
||||
for (int t = 0; t < threadCount; t++) {
|
||||
final Random rnd = new Random(random.nextLong());
|
||||
final int count = atLeast(rnd, 20000);
|
||||
exec.execute(new Runnable() {
|
||||
public void run() {
|
||||
final int count = atLeast(rnd, 10000);
|
||||
for (int i = 0; i < count; i++) {
|
||||
final int j = rnd.nextInt(keyCount);
|
||||
switch (rnd.nextInt(4)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user