activemq-artemis git commit: NO-JIRA: Fixing intermittent failures on PluginTests

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

activemq-artemis git commit: NO-JIRA: Fixing intermittent failures on PluginTests

clebertsuconic-2
Repository: activemq-artemis
Updated Branches:
  refs/heads/master 3820ab8bb -> 36a948b22


NO-JIRA: Fixing intermittent failures on PluginTests


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/36a948b2
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/36a948b2
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/36a948b2

Branch: refs/heads/master
Commit: 36a948b225b2eb9301b9e0be8bef19b4d58ef9c8
Parents: 3820ab8
Author: Clebert Suconic <[hidden email]>
Authored: Wed Jul 12 21:15:31 2017 -0400
Committer: Clebert Suconic <[hidden email]>
Committed: Wed Jul 12 21:15:31 2017 -0400

----------------------------------------------------------------------
 .../tests/integration/plugin/MethodCalledVerifier.java        | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/36a948b2/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/MethodCalledVerifier.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/MethodCalledVerifier.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/MethodCalledVerifier.java
index 493f7de..de339f5 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/MethodCalledVerifier.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/MethodCalledVerifier.java
@@ -81,9 +81,6 @@ public class MethodCalledVerifier implements ActiveMQServerPlugin {
    public static final String BEFORE_DEPLOY_BRIDGE = "beforeDeployBridge";
    public static final String AFTER_DEPLOY_BRIDGE = "afterDeployBridge";
 
-   /**
-    * @param methods
-    */
    public MethodCalledVerifier(Map<String, AtomicInteger> methodCalls) {
       super();
       this.methodCalls = methodCalls;
@@ -266,6 +263,10 @@ public class MethodCalledVerifier implements ActiveMQServerPlugin {
 
    public void validatePluginMethodsEquals(int count, String... names) {
       Arrays.asList(names).forEach(name -> {
+         try {
+            Wait.waitFor(() -> count == methodCalls.getOrDefault(name, new AtomicInteger()).get());
+         } catch (Throwable ignored) {
+         }
          assertEquals("validating method " + name, count, methodCalls.getOrDefault(name, new AtomicInteger()).get());
       });
    }

Loading...