NO-JIRA: Fixing intermittent failures on PluginTests

This commit is contained in:
Clebert Suconic 2017-07-12 21:15:31 -04:00
parent 3820ab8bb5
commit 36a948b225
1 changed files with 4 additions and 3 deletions

View File

@ -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());
});
}