[infinispan-commits] Infinispan SVN: r674 - trunk/core/src/test/java/org/infinispan/distribution.
infinispan-commits at lists.jboss.org
infinispan-commits at lists.jboss.org
Thu Aug 13 11:33:48 EDT 2009
Author: manik.surtani at jboss.com
Date: 2009-08-13 11:33:47 -0400 (Thu, 13 Aug 2009)
New Revision: 674
Modified:
trunk/core/src/test/java/org/infinispan/distribution/BaseDistFunctionalTest.java
trunk/core/src/test/java/org/infinispan/distribution/RehashJoinTest.java
Log:
[ISPN-65] (Rehashing) increased timeouts
Modified: trunk/core/src/test/java/org/infinispan/distribution/BaseDistFunctionalTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/distribution/BaseDistFunctionalTest.java 2009-08-13 15:16:24 UTC (rev 673)
+++ trunk/core/src/test/java/org/infinispan/distribution/BaseDistFunctionalTest.java 2009-08-13 15:33:47 UTC (rev 674)
@@ -22,6 +22,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
+import static java.util.concurrent.TimeUnit.SECONDS;
@Test(groups = "functional", testName = "distribution.BaseDistFunctionalTest")
public abstract class BaseDistFunctionalTest extends MultipleCacheManagersTest {
@@ -67,11 +68,11 @@
List<Cache> clist = new ArrayList<Cache>(cacheManagers.size());
for (CacheManager cm : cacheManagers) clist.add(cm.getCache(cacheName));
assert clist.size() == 4;
- waitForJoinTasksToComplete(120000, clist.toArray(new Cache[clist.size()]));
+ waitForJoinTasksToComplete(SECONDS.toMillis(240), clist.toArray(new Cache[clist.size()]));
// seed this with an initial cache. Any one will do.
Cache seed = caches.get(0);
- DefaultConsistentHash ch = getDefaultConsistentHash(seed, 120000);
+ DefaultConsistentHash ch = getDefaultConsistentHash(seed, SECONDS.toMillis(240));
List<Cache<Object, String>> reordered = new ArrayList<Cache<Object, String>>();
for (Address a : ch.positions.values()) {
Modified: trunk/core/src/test/java/org/infinispan/distribution/RehashJoinTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/distribution/RehashJoinTest.java 2009-08-13 15:16:24 UTC (rev 673)
+++ trunk/core/src/test/java/org/infinispan/distribution/RehashJoinTest.java 2009-08-13 15:33:47 UTC (rev 674)
@@ -12,6 +12,7 @@
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.CountDownLatch;
+import static java.util.concurrent.TimeUnit.SECONDS;
@Test(testName = "distribution.RehashJoinTest", groups = "functional")
public class RehashJoinTest extends BaseDistFunctionalTest {
@@ -54,7 +55,7 @@
Cache<Object, String> joiner = joinerManager.getCache(cacheName);
// need to wait for the joiner to, well, join.
- TestingUtil.blockUntilViewsReceived(60000, cacheManagers.toArray(new CacheManager[cacheManagers.size()]));
+ TestingUtil.blockUntilViewsReceived(SECONDS.toMillis(240), cacheManagers.toArray(new CacheManager[cacheManagers.size()]));
// where does the joiner sit in relation to the other caches?
int joinerPos = locateJoiner(joinerManager.getAddress());
@@ -135,15 +136,16 @@
log.info("Number of cache manager views to wait for: {0}", cacheManagerArray.length);
// need to wait for the joiner to, well, join.
- TestingUtil.blockUntilViewsReceived(240000, cacheManagerArray);
+ TestingUtil.blockUntilViewsReceived(SECONDS.toMillis(240), cacheManagerArray);
// where do the joiners sit in relation to the other caches?
- waitForJoinTasksToComplete(120000, joiners);
+ waitForJoinTasksToComplete(SECONDS.toMillis(240), joiners);
+
// need to wait a *short while* before we attempt to locate joiners, since post-join invalidation messages are sent async.
// TODO replace this with some form of command detection on remote nodes.
// join tasks happen sequentially as well, so this needs some time to finish
- TestingUtil.sleepThread(1000);
+ TestingUtil.sleepThread(SECONDS.toMillis(2));
int[] joinersPos = new int[numJoiners];
for (i = 0; i < numJoiners; i++) joinersPos[i] = locateJoiner(joinerManagers[i].getAddress());
@@ -163,7 +165,7 @@
private int locateJoiner(Address joinerAddress) {
for (Cache c : Arrays.asList(c1, c2, c3, c4)) {
- DefaultConsistentHash dch = getDefaultConsistentHash(c, 120000);
+ DefaultConsistentHash dch = getDefaultConsistentHash(c, SECONDS.toMillis(240));
int i = 0;
for (Address a : dch.positions.values()) {
if (a.equals(joinerAddress)) return i;
More information about the infinispan-commits
mailing list