You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ta...@apache.org on 2015/10/28 14:48:12 UTC

[1/2] qpid-jms git commit: QPIDJMS-132 Update the runner to use a multiplier value to extend test timeouts.

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 <ta...@gmail.com>
Authored: Wed Oct 28 09:42:26 2015 -0400
Committer: Timothy Bish <ta...@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


[2/2] qpid-jms git commit: QPIDJMS-132 Add log output indicating the progress of test repeats.

Posted by ta...@apache.org.
QPIDJMS-132 Add log output indicating the progress of test repeats.

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

Branch: refs/heads/master
Commit: 810410747c0b46c866bc5b78c97e9f5ab96a59d3
Parents: 0a39cab
Author: Timothy Bish <ta...@gmail.com>
Authored: Wed Oct 28 09:47:52 2015 -0400
Committer: Timothy Bish <ta...@gmail.com>
Committed: Wed Oct 28 09:47:52 2015 -0400

----------------------------------------------------------------------
 .../test/java/org/apache/qpid/jms/util/RepeatStatement.java | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/81041074/qpid-jms-client/src/test/java/org/apache/qpid/jms/util/RepeatStatement.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/util/RepeatStatement.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/util/RepeatStatement.java
index 9440da2..0b2b543 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/util/RepeatStatement.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/util/RepeatStatement.java
@@ -17,9 +17,13 @@
 package org.apache.qpid.jms.util;
 
 import org.junit.runners.model.Statement;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public final class RepeatStatement extends Statement {
 
+    private static final Logger LOG = LoggerFactory.getLogger(RepeatStatement.class);
+
     private final int repetitions;
     private final boolean untilFailure;
     private final Statement statement;
@@ -43,6 +47,11 @@ public final class RepeatStatement extends Statement {
     @Override
     public void evaluate() throws Throwable {
         for (int i = 0; i < repetitions && !untilFailure; i++) {
+            if (untilFailure) {
+                LOG.info("Running test iteration: {}.", i + 1);
+            } else {
+                LOG.info("Running test iteration: {} of configured repetitions: {}", i + 1, repetitions);
+            }
             statement.evaluate();
         }
     }


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