[jbosscache-commits] JBoss Cache SVN: r6361 - core/trunk/src/test/java/org/jboss/cache/statetransfer.
jbosscache-commits at lists.jboss.org
jbosscache-commits at lists.jboss.org
Tue Jul 22 17:58:21 EDT 2008
Author: manik.surtani at jboss.com
Date: 2008-07-22 17:58:20 -0400 (Tue, 22 Jul 2008)
New Revision: 6361
Modified:
core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransferConcurrencyTest.java
Log:
faster than a full sleep
Modified: core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransferConcurrencyTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransferConcurrencyTest.java 2008-07-22 21:57:49 UTC (rev 6360)
+++ core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransferConcurrencyTest.java 2008-07-22 21:58:20 UTC (rev 6361)
@@ -111,17 +111,14 @@
semaphore.release(count);
// Sleep to ensure the threads get all the semaphore tickets
- TestingUtil.sleepThread((long) 1000);
+ while (semaphore.availablePermits() != 0) TestingUtil.sleepThread(100);
// Reacquire the semaphore tickets; when we have them all
// we know the threads are done
for (int i = 0; i < count; i++)
{
boolean acquired = semaphore.tryAcquire(60, TimeUnit.SECONDS);
- if (!acquired)
- {
- fail("failed to acquire semaphore " + i);
- }
+ if (!acquired) fail("failed to acquire semaphore " + i);
}
// allow any async calls to clear
More information about the jbosscache-commits
mailing list