[ISPN-277] (LRU data container endlesly looping or exhibiting heavy contention) Update to trunk and check if testManyUsers runs fine now.

git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@18077 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Galder Zamarreno 2009-11-27 16:53:33 +00:00
parent 393f09eeba
commit 05a02472a9
2 changed files with 34 additions and 34 deletions

View File

@ -17,7 +17,7 @@
<description>Integration of Hibernate with Infinispan</description>
<properties>
<version.infinispan>4.0.0.CR2</version.infinispan>
<version.infinispan>4.0.0-SNAPSHOT</version.infinispan>
<version.hsqldb>1.8.0.2</version.hsqldb>
<version.cglib>2.2</version.cglib>
<version.javassist>3.4.GA</version.javassist>

View File

@ -189,39 +189,39 @@ public class ConcurrentWriteTest extends SingleNodeTestCase {
}
// /**
// * TODO: This will fail until ISPN-??? has been fixed.
// *
// * @throws Exception
// */
// public void testManyUsers() throws Throwable {
// try {
// // setup - create users
// for (int i = 0; i < USER_COUNT; i++) {
// Customer customer = createCustomer(0);
// getCustomerIDs().add(customer.getId());
// }
// assertEquals("failed to create enough Customers", USER_COUNT, getCustomerIDs().size());
//
// final ExecutorService executor = Executors.newFixedThreadPool(USER_COUNT);
//
// CyclicBarrier barrier = new CyclicBarrier(USER_COUNT + 1);
// List<Future<Void>> futures = new ArrayList<Future<Void>>(USER_COUNT);
// for (Integer customerId : getCustomerIDs()) {
// Future<Void> future = executor.submit(new UserRunner(customerId, barrier));
// futures.add(future);
// Thread.sleep(LAUNCH_INTERVAL_MILLIS); // rampup
// }
//// barrier.await(); // wait for all threads to be ready
// barrier.await(45, TimeUnit.SECONDS); // wait for all threads to finish
// log.info("All threads finished, let's shutdown the executor and check whether any exceptions were reported");
// for (Future<Void> future : futures) future.get();
// log.info("All future gets checked");
// } catch (Throwable t) {
// log.error("Error running test", t);
// throw t;
// }
// }
/**
* TODO: This will fail until ISPN-??? has been fixed.
*
* @throws Exception
*/
public void testManyUsers() throws Throwable {
try {
// setup - create users
for (int i = 0; i < USER_COUNT; i++) {
Customer customer = createCustomer(0);
getCustomerIDs().add(customer.getId());
}
assertEquals("failed to create enough Customers", USER_COUNT, getCustomerIDs().size());
final ExecutorService executor = Executors.newFixedThreadPool(USER_COUNT);
CyclicBarrier barrier = new CyclicBarrier(USER_COUNT + 1);
List<Future<Void>> futures = new ArrayList<Future<Void>>(USER_COUNT);
for (Integer customerId : getCustomerIDs()) {
Future<Void> future = executor.submit(new UserRunner(customerId, barrier));
futures.add(future);
Thread.sleep(LAUNCH_INTERVAL_MILLIS); // rampup
}
// barrier.await(); // wait for all threads to be ready
barrier.await(45, TimeUnit.SECONDS); // wait for all threads to finish
log.info("All threads finished, let's shutdown the executor and check whether any exceptions were reported");
for (Future<Void> future : futures) future.get();
log.info("All future gets checked");
} catch (Throwable t) {
log.error("Error running test", t);
throw t;
}
}
public void cleanup() throws Exception {
getCustomerIDs().clear();