From 36a948b225b2eb9301b9e0be8bef19b4d58ef9c8 Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Wed, 12 Jul 2017 21:15:31 -0400 Subject: [PATCH] NO-JIRA: Fixing intermittent failures on PluginTests --- .../tests/integration/plugin/MethodCalledVerifier.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 493f7de434..de339f5964 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 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()); }); }