[jbosscache-commits] JBoss Cache SVN: r5646 - core/trunk/src/test/java/org/jboss/cache/buddyreplication.
jbosscache-commits at lists.jboss.org
jbosscache-commits at lists.jboss.org
Wed Apr 23 09:48:19 EDT 2008
Author: manik.surtani at jboss.com
Date: 2008-04-23 09:48:19 -0400 (Wed, 23 Apr 2008)
New Revision: 5646
Modified:
core/trunk/src/test/java/org/jboss/cache/buddyreplication/GravitationCleanupTest.java
Log:
Added delay for async cleanup calls
Modified: core/trunk/src/test/java/org/jboss/cache/buddyreplication/GravitationCleanupTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/buddyreplication/GravitationCleanupTest.java 2008-04-23 13:32:58 UTC (rev 5645)
+++ core/trunk/src/test/java/org/jboss/cache/buddyreplication/GravitationCleanupTest.java 2008-04-23 13:48:19 UTC (rev 5646)
@@ -2,6 +2,7 @@
import org.jboss.cache.CacheSPI;
import org.jboss.cache.Fqn;
+import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.util.CachePrinter;
import org.testng.annotations.Test;
@@ -59,6 +60,8 @@
// now do a gravitate call.
assert buddy.get(fqn, key).equals(value) : "Data should have gravitated!";
+ // gravitation cleanup calls are async.
+ cleanupDelay();
System.out.println("dataOwner: " + CachePrinter.printCacheLockingInfo(dataOwner));
System.out.println("buddy: " + CachePrinter.printCacheLockingInfo(buddy));
@@ -105,6 +108,9 @@
// now do a gravitate call.
assert thirdInstance.get(fqn, key).equals(value) : "Data should have gravitated!";
+ // gravitation cleanup calls are async.
+ cleanupDelay();
+
System.out.println("dataOwner: " + CachePrinter.printCacheLockingInfo(dataOwner));
System.out.println("buddy: " + CachePrinter.printCacheLockingInfo(buddy));
System.out.println("thirdInstance: " + CachePrinter.printCacheLockingInfo(thirdInstance));
@@ -121,4 +127,9 @@
assert buddy.peek(fqn.getParent(), false) == null : "Should not have any part of the data";
assert buddy.peek(BuddyFqnTransformer.getBackupFqn(dataOwner.getLocalAddress(), fqn), false) == null : "Should NOT have backup data";
}
+
+ private void cleanupDelay()
+ {
+ TestingUtil.sleepThread(250);
+ }
}
More information about the jbosscache-commits
mailing list