[jboss-cvs] CacheBenchFwk/src/org/cachebench/tests ...
Manik Surtani
manik at jboss.org
Mon May 21 09:06:09 EDT 2007
User: msurtani
Date: 07/05/21 09:06:09
Modified: src/org/cachebench/tests SimpleTest.java
Log:
Better executor termination timeout
Revision Changes Path
1.9 +10 -7 CacheBenchFwk/src/org/cachebench/tests/SimpleTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: SimpleTest.java
===================================================================
RCS file: /cvsroot/jboss/CacheBenchFwk/src/org/cachebench/tests/SimpleTest.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- SimpleTest.java 21 May 2007 13:03:56 -0000 1.8
+++ SimpleTest.java 21 May 2007 13:06:09 -0000 1.9
@@ -27,7 +27,7 @@
protected AtomicLong numberOfBytesPut = new AtomicLong(0);
protected long elapsedSecondsForAllPuts = 0;
protected ExecutorService executor;
- private static final int EXECUTOR_SHUTDOWN_TIMEOUT_HOURS = 24; // This could be a long while. Give it a healthy upper limit
+ private static final int EXECUTOR_SHUTDOWN_TIMEOUT_POLL_SECS = 60;
protected TestResult performTestWithObjectType(String testCaseName, CacheWrapper cache, Class valueClass, String testName, int sampleSize, int numThreads) throws Exception
{
@@ -226,15 +226,18 @@
{
// now that just told us that all the tasks have been submitted. Lets check that the executor has finished everything.
executor.shutdown();
+ while (!executor.isTerminated())
+ {
try
{
- executor.awaitTermination(EXECUTOR_SHUTDOWN_TIMEOUT_HOURS * 60 * 60, TimeUnit.SECONDS);
+ executor.awaitTermination(EXECUTOR_SHUTDOWN_TIMEOUT_POLL_SECS, TimeUnit.SECONDS);
}
catch (InterruptedException e)
{
// do nothing?
}
}
+ }
private long calculateSerializedSize(Object value)
{
More information about the jboss-cvs-commits
mailing list