summaryrefslogtreecommitdiff
path: root/qpid/java/perftests/src
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/java/perftests/src')
-rw-r--r--qpid/java/perftests/src/main/java/org/apache/qpid/disttest/ControllerRunner.java4
-rw-r--r--qpid/java/perftests/src/main/java/org/apache/qpid/disttest/DistributedTestConstants.java6
-rw-r--r--qpid/java/perftests/src/main/java/org/apache/qpid/disttest/controller/Controller.java13
-rw-r--r--qpid/java/perftests/src/main/java/org/apache/qpid/disttest/controller/TestRunner.java15
4 files changed, 26 insertions, 12 deletions
diff --git a/qpid/java/perftests/src/main/java/org/apache/qpid/disttest/ControllerRunner.java b/qpid/java/perftests/src/main/java/org/apache/qpid/disttest/ControllerRunner.java
index 31ba4628c5..aea0ea301a 100644
--- a/qpid/java/perftests/src/main/java/org/apache/qpid/disttest/ControllerRunner.java
+++ b/qpid/java/perftests/src/main/java/org/apache/qpid/disttest/ControllerRunner.java
@@ -103,6 +103,10 @@ public class ControllerRunner extends AbstractRunner
runTest(controller, testConfigFile);
}
}
+ catch(Exception e)
+ {
+ LOGGER.error("Problem running test", e);
+ }
finally
{
controller.stopAllRegisteredClients();
diff --git a/qpid/java/perftests/src/main/java/org/apache/qpid/disttest/DistributedTestConstants.java b/qpid/java/perftests/src/main/java/org/apache/qpid/disttest/DistributedTestConstants.java
index c4892edca9..a6f872e841 100644
--- a/qpid/java/perftests/src/main/java/org/apache/qpid/disttest/DistributedTestConstants.java
+++ b/qpid/java/perftests/src/main/java/org/apache/qpid/disttest/DistributedTestConstants.java
@@ -26,8 +26,10 @@ public abstract class DistributedTestConstants
public static final String MSG_COMMAND_PROPERTY = "COMMAND";
public static final String MSG_JSON_PROPERTY = "JSON";
- public static final long REGISTRATION_TIMEOUT = 60000;
- public static final long COMMAND_RESPONSE_TIMEOUT = 10000;
+ public static final long REGISTRATION_TIMEOUT = 60 * 1000;
+
+ /** set to a long time out because stopping clients can take a long time */
+ public static final long COMMAND_RESPONSE_TIMEOUT = 120 * 1000;
public static final String CONTROLLER_QUEUE_JNDI_NAME = "controllerqueue";
}
diff --git a/qpid/java/perftests/src/main/java/org/apache/qpid/disttest/controller/Controller.java b/qpid/java/perftests/src/main/java/org/apache/qpid/disttest/controller/Controller.java
index 7c935065f0..513e633566 100644
--- a/qpid/java/perftests/src/main/java/org/apache/qpid/disttest/controller/Controller.java
+++ b/qpid/java/perftests/src/main/java/org/apache/qpid/disttest/controller/Controller.java
@@ -92,15 +92,18 @@ public class Controller
}
}
- private void awaitLatch(CountDownLatch latch, long timeout, String messageWithOneDecimalPlaceholder)
+ private void awaitStopResponses(CountDownLatch latch, long timeout)
{
+ String message = "Timed out after %d waiting for stop command responses. Expecting %d more responses.";
+
try
{
- final boolean countedDownOK = latch.await(timeout, TimeUnit.MILLISECONDS);
+ boolean countedDownOK = latch.await(timeout, TimeUnit.MILLISECONDS);
if (!countedDownOK)
{
- final long latchCount = latch.getCount();
- String formattedMessage = String.format(messageWithOneDecimalPlaceholder, latchCount);
+ long latchCount = latch.getCount();
+ String formattedMessage = String.format(message, timeout, latchCount);
+ LOGGER.error(formattedMessage);
throw new DistributedTestException(formattedMessage);
}
}
@@ -141,7 +144,7 @@ public class Controller
_jmsDelegate.sendCommandToClient(clientName, command);
}
- awaitLatch(_stopClientsResponseLatch, _commandResponseTimeout, "Timed out waiting for stop command responses. Expecting %d more responses.");
+ awaitStopResponses(_stopClientsResponseLatch, _commandResponseTimeout);
LOGGER.info("Stopped all clients");
}
diff --git a/qpid/java/perftests/src/main/java/org/apache/qpid/disttest/controller/TestRunner.java b/qpid/java/perftests/src/main/java/org/apache/qpid/disttest/controller/TestRunner.java
index eb110a4234..4ad282b039 100644
--- a/qpid/java/perftests/src/main/java/org/apache/qpid/disttest/controller/TestRunner.java
+++ b/qpid/java/perftests/src/main/java/org/apache/qpid/disttest/controller/TestRunner.java
@@ -104,6 +104,11 @@ public class TestRunner
return _testResult;
}
+ catch(RuntimeException e)
+ {
+ LOGGER.error("Couldn't run test", e);
+ throw e;
+ }
finally
{
_jmsDelegate.removeCommandListener(participantResultListener);
@@ -140,7 +145,6 @@ public class TestRunner
}
Runtime.getRuntime().removeShutdownHook(_removeQueuesShutdownHook);
-
}
}
@@ -176,7 +180,7 @@ public class TestRunner
void awaitCommandResponses()
{
- awaitLatch(_commandResponseLatch, _commandResponseTimeout, "Timed out waiting for command responses. Expecting %d more responses.");
+ awaitLatch(_commandResponseLatch, _commandResponseTimeout, "Timed out waiting for command responses");
}
@@ -204,7 +208,7 @@ public class TestRunner
{
try
{
- awaitLatch(_testResultsLatch, interval, "Waiting for participant results... Expecting %d more responses.");
+ awaitLatch(_testResultsLatch, interval, "Timed out waiting for participant results");
}
catch (DistributedTestException e)
{
@@ -276,7 +280,7 @@ public class TestRunner
_jmsDelegate.sendCommandToClient(registeredClientName, command);
}
- private void awaitLatch(CountDownLatch latch, long timeout, String messageWithOneDecimalPlaceholder)
+ private void awaitLatch(CountDownLatch latch, long timeout, String message)
{
try
{
@@ -284,7 +288,8 @@ public class TestRunner
if (!countedDownOK)
{
final long latchCount = latch.getCount();
- String formattedMessage = String.format(messageWithOneDecimalPlaceholder, latchCount);
+ String formattedMessage = "After " + timeout + "ms ... " + message + " ... Expecting " + latchCount + " more responses.";
+ LOGGER.error(formattedMessage);
throw new DistributedTestException(formattedMessage);
}
}