diff options
| author | Keith Wall <kwall@apache.org> | 2012-07-17 14:09:37 +0000 |
|---|---|---|
| committer | Keith Wall <kwall@apache.org> | 2012-07-17 14:09:37 +0000 |
| commit | 0e22d4ab6aaa6d300eb150dde3a4702cace043c5 (patch) | |
| tree | dd8c8db6732ac2650384db5e79376777ea181902 /qpid/java/perftests/src | |
| parent | 1b11ea556b73c4374a1c93d8707dc9aa57b209e1 (diff) | |
| download | qpid-python-0e22d4ab6aaa6d300eb150dde3a4702cace043c5.tar.gz | |
QPID-4143: tweaked topic test config to introduce a start delay on message production, allowing the consumers enough time to implicitly create the queues (unfortunately the Qpid client can't explicitly create topics).
Also improved error reporting and increased time outs to better cope with large scale tests.
Applied patch from Philip Harvey <phil@philharveyonline.com>
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1362502 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/perftests/src')
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); } } |
