You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by us...@apache.org on 2011/12/20 11:53:17 UTC
svn commit: r1221195 -
/lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/TestWeakIdentityMap.java
Author: uschindler
Date: Tue Dec 20 10:53:17 2011
New Revision: 1221195
URL: http://svn.apache.org/viewvc?rev=1221195&view=rev
Log:
Make test not so expensive nightly (we want to test only our ref cleanup functionality not concurrency of the backingMap)
Modified:
lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/TestWeakIdentityMap.java
Modified: lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/TestWeakIdentityMap.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/TestWeakIdentityMap.java?rev=1221195&r1=1221194&r2=1221195&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/TestWeakIdentityMap.java (original)
+++ lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/TestWeakIdentityMap.java Tue Dec 20 10:53:17 2011
@@ -113,7 +113,8 @@ public class TestWeakIdentityMap extends
}
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
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)) {