qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject [1/2] qpid-jms git commit: QPIDJMS-132 Update the runner to use a multiplier value to extend test timeouts.
Date Wed, 28 Oct 2015 13:48:12 GMT
Repository: qpid-jms
Updated Branches:
  refs/heads/master acd2ebbaa -> 810410747


QPIDJMS-132 Update the runner to use a multiplier value to extend test
timeouts.

Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/0a39cab9
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/0a39cab9
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/0a39cab9

Branch: refs/heads/master
Commit: 0a39cab9e2c35371cceba6a816469bd92ac2f6f7
Parents: acd2ebb
Author: Timothy Bish <tabish121@gmail.com>
Authored: Wed Oct 28 09:42:26 2015 -0400
Committer: Timothy Bish <tabish121@gmail.com>
Committed: Wed Oct 28 09:42:26 2015 -0400

----------------------------------------------------------------------
 .../apache/qpid/jms/util/QPidJMSTestRunner.java | 23 ++++++++++++++------
 1 file changed, 16 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/0a39cab9/qpid-jms-client/src/test/java/org/apache/qpid/jms/util/QPidJMSTestRunner.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/util/QPidJMSTestRunner.java
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/util/QPidJMSTestRunner.java
index 2e94944..d7d110f 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/util/QPidJMSTestRunner.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/util/QPidJMSTestRunner.java
@@ -58,18 +58,27 @@ public class QPidJMSTestRunner extends BlockJUnit4ClassRunner {
     @SuppressWarnings("deprecation")
     @Override
     protected Statement withPotentialTimeout(FrameworkMethod frameworkMethod, Object testInstance,
Statement next) {
-        long originalTimeout = getOriginalTimeout(frameworkMethod);
+        long testTimeout = getOriginalTimeout(frameworkMethod);
 
-        if (originalTimeout > 0) {
-            long additionalTimeUnderCI = Long.getLong("org.apache.qpid.jms.testTimeoutIncrement",
0);
+        if (testTimeout > 0) {
+            String multiplierString = System.getProperty("org.apache.qpid.jms.testTimeoutMultiplier");
+            double multiplier = 0.0;
 
-            if (additionalTimeUnderCI > 0) {
-                LOG.info("Adding additional time {}ms to test timeout {}ms", additionalTimeUnderCI,
originalTimeout);
-                originalTimeout += additionalTimeUnderCI;
+            try {
+                multiplier = Double.parseDouble(multiplierString);
+            } catch (NullPointerException npe) {
+            } catch (NumberFormatException nfe) {
+                LOG.warn("Ignoring testTimeoutMultiplier not set to a valid value: " + multiplierString);
+            }
+
+            if (multiplier > 0.0) {
+                LOG.info("Test timeout multiple {} applied to test timeout {}ms: new timeout
= {}",
+                    multiplier, testTimeout, (long) (testTimeout * multiplier));
+                testTimeout = (long) (testTimeout * multiplier);
             }
 
             next = FailOnTimeout.builder().
-                withTimeout(originalTimeout, TimeUnit.MILLISECONDS).build(next);
+                withTimeout(testTimeout, TimeUnit.MILLISECONDS).build(next);
         } else {
             next = super.withPotentialTimeout(frameworkMethod, testInstance, next);
         }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message