You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2019/05/20 20:47:48 UTC
[activemq-artemis] branch master updated: NO-JIRA fix Intermittent
failures in artemis-junit
This is an automated email from the ASF dual-hosted git repository.
clebertsuconic pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git
The following commit(s) were added to refs/heads/master by this push:
new 2cf7c32 NO-JIRA fix Intermittent failures in artemis-junit
new bb02d96 This closes #2673
2cf7c32 is described below
commit 2cf7c321285583e7eb2722cef2fcbd24537b7d89
Author: Clebert Suconic <cl...@apache.org>
AuthorDate: Mon May 20 15:37:44 2019 -0400
NO-JIRA fix Intermittent failures in artemis-junit
---
.../activemq/artemis/junit/ThreadLeakCheckRule.java | 7 +++++++
.../junit/ActiveMQDynamicProducerResourceTest.java | 14 ++------------
...amicProducerResourceWithoutAddressExceptionTest.java | 3 ---
...tiveMQDynamicProducerResourceWithoutAddressTest.java | 14 ++------------
.../artemis/junit/ActiveMQProducerResourceTest.java | 3 ---
...EmbeddedActiveMQResourceCustomConfigurationTest.java | 6 ------
.../EmbeddedActiveMQResourceFileConfigurationTest.java | 6 ------
.../artemis/junit/EmbeddedActiveMQResourceTest.java | 12 +-----------
...mbeddedJMSResourceMultipleFileConfigurationTest.java | 6 ------
.../artemis/junit/EmbeddedJMSResourceQueueTest.java | 13 +------------
.../EmbeddedJMSResourceSingleFileConfigurationTest.java | 6 ------
.../artemis/junit/EmbeddedJMSResourceTopicTest.java | 13 +------------
.../junit/MultipleEmbeddedActiveMQResourcesTest.java | 5 -----
.../artemis/junit/MultipleEmbeddedJMSResourcesTest.java | 17 ++---------------
14 files changed, 16 insertions(+), 109 deletions(-)
diff --git a/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ThreadLeakCheckRule.java b/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ThreadLeakCheckRule.java
index 62b1435..3fc8d2f 100644
--- a/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ThreadLeakCheckRule.java
+++ b/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ThreadLeakCheckRule.java
@@ -41,6 +41,13 @@ public class ThreadLeakCheckRule extends ExternalResource {
private static Set<String> knownThreads = new HashSet<>();
+ static {
+ addKownThread("MemoryPoolMXBean notification dispatcher");
+ addKownThread("threadDeathWatcher");
+ addKownThread("SeedGenerator Thread");
+ addKownThread("Attach Listener");
+ }
+
boolean enabled = true;
private Map<Thread, StackTraceElement[]> previousThreads;
diff --git a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResourceTest.java b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResourceTest.java
index 891a52f..cf7f84a 100644
--- a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResourceTest.java
+++ b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResourceTest.java
@@ -26,7 +26,6 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.RuleChain;
-import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
public class ActiveMQDynamicProducerResourceTest {
@@ -44,9 +43,6 @@ public class ActiveMQDynamicProducerResourceTest {
TEST_PROPERTIES = new HashMap<String, Object>(2);
TEST_PROPERTIES.put("PropertyOne", "Property Value 1");
TEST_PROPERTIES.put("PropertyTwo", "Property Value 2");
-
- ThreadLeakCheckRule.addKownThread("MemoryPoolMXBean notification dispatcher");
- ThreadLeakCheckRule.addKownThread("threadDeathWatcher");
}
EmbeddedActiveMQResource server = new EmbeddedActiveMQResource();
@@ -63,14 +59,8 @@ public class ActiveMQDynamicProducerResourceTest {
public void tearDown() throws Exception {
assertNotNull(String.format(ASSERT_SENT_FORMAT, TEST_QUEUE_ONE), sentOne);
assertNotNull(String.format(ASSERT_SENT_FORMAT, TEST_QUEUE_TWO), sentTwo);
- Wait.waitFor(new Wait.Condition() {
- @Override
- public boolean isSatisfied() throws Exception {
- return server.getMessageCount(TEST_QUEUE_ONE) == 1 && server.getMessageCount(TEST_QUEUE_TWO) == 1;
- }
- }, 5000, 100);
- assertEquals(String.format(ASSERT_COUNT_FORMAT, TEST_QUEUE_ONE), 1, server.getMessageCount(TEST_QUEUE_ONE));
- assertEquals(String.format(ASSERT_COUNT_FORMAT, TEST_QUEUE_TWO), 1, server.getMessageCount(TEST_QUEUE_TWO));
+ Wait.assertEquals(1L, () -> server.getMessageCount(TEST_QUEUE_ONE), 30_000, 10);
+ Wait.assertEquals(1L, () -> server.getMessageCount(TEST_QUEUE_TWO), 30_000, 10);
ClientMessage receivedOne = server.receiveMessage(TEST_QUEUE_ONE);
assertNotNull(String.format(ASSERT_RECEIVED_FORMAT, TEST_QUEUE_ONE), receivedOne);
diff --git a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResourceWithoutAddressExceptionTest.java b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResourceWithoutAddressExceptionTest.java
index 1af2a40..47e6a2b 100644
--- a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResourceWithoutAddressExceptionTest.java
+++ b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResourceWithoutAddressExceptionTest.java
@@ -37,9 +37,6 @@ public class ActiveMQDynamicProducerResourceWithoutAddressExceptionTest {
TEST_PROPERTIES = new HashMap<String, Object>(2);
TEST_PROPERTIES.put("PropertyOne", "Property Value 1");
TEST_PROPERTIES.put("PropertyTwo", "Property Value 2");
-
- ThreadLeakCheckRule.addKownThread("MemoryPoolMXBean notification dispatcher");
- ThreadLeakCheckRule.addKownThread("threadDeathWatcher");
}
EmbeddedActiveMQResource server = new EmbeddedActiveMQResource();
diff --git a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResourceWithoutAddressTest.java b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResourceWithoutAddressTest.java
index f3c5d99..b945ea6 100644
--- a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResourceWithoutAddressTest.java
+++ b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResourceWithoutAddressTest.java
@@ -27,7 +27,6 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.RuleChain;
-import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
public class ActiveMQDynamicProducerResourceWithoutAddressTest {
@@ -45,9 +44,6 @@ public class ActiveMQDynamicProducerResourceWithoutAddressTest {
TEST_PROPERTIES = new HashMap<String, Object>(2);
TEST_PROPERTIES.put("PropertyOne", "Property Value 1");
TEST_PROPERTIES.put("PropertyTwo", "Property Value 2");
-
- ThreadLeakCheckRule.addKownThread("MemoryPoolMXBean notification dispatcher");
- ThreadLeakCheckRule.addKownThread("threadDeathWatcher");
}
EmbeddedActiveMQResource server = new EmbeddedActiveMQResource();
@@ -71,14 +67,8 @@ public class ActiveMQDynamicProducerResourceWithoutAddressTest {
public void tearDown() throws Exception {
assertNotNull(String.format(ASSERT_SENT_FORMAT, TEST_QUEUE_ONE), sentOne);
assertNotNull(String.format(ASSERT_SENT_FORMAT, TEST_QUEUE_TWO), sentTwo);
- Wait.waitFor(new Wait.Condition() {
- @Override
- public boolean isSatisfied() throws Exception {
- return server.getMessageCount(TEST_QUEUE_ONE) == 1 && server.getMessageCount(TEST_QUEUE_TWO) == 1;
- }
- }, 5000, 100);
- assertEquals(String.format(ASSERT_COUNT_FORMAT, TEST_QUEUE_ONE), 1, server.getMessageCount(TEST_QUEUE_ONE));
- assertEquals(String.format(ASSERT_COUNT_FORMAT, TEST_QUEUE_TWO), 1, server.getMessageCount(TEST_QUEUE_TWO));
+ Wait.assertEquals(1L, ()-> server.getMessageCount(TEST_QUEUE_ONE), 30_000, 10);
+ Wait.assertEquals(1L, ()-> server.getMessageCount(TEST_QUEUE_TWO), 30_000, 10);
ClientMessage receivedOne = server.receiveMessage(TEST_QUEUE_ONE);
assertNotNull(String.format(ASSERT_RECEIVED_FORMAT, TEST_QUEUE_ONE), receivedOne);
diff --git a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQProducerResourceTest.java b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQProducerResourceTest.java
index 695fef5..82be91b 100644
--- a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQProducerResourceTest.java
+++ b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQProducerResourceTest.java
@@ -43,9 +43,6 @@ public class ActiveMQProducerResourceTest {
TEST_PROPERTIES = new HashMap<String, Object>(2);
TEST_PROPERTIES.put("PropertyOne", "Property Value 1");
TEST_PROPERTIES.put("PropertyTwo", "Property Value 2");
-
- ThreadLeakCheckRule.addKownThread("MemoryPoolMXBean notification dispatcher");
- ThreadLeakCheckRule.addKownThread("threadDeathWatcher");
}
EmbeddedActiveMQResource server = new EmbeddedActiveMQResource();
diff --git a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceCustomConfigurationTest.java b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceCustomConfigurationTest.java
index 006fdd7..37cff89 100644
--- a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceCustomConfigurationTest.java
+++ b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceCustomConfigurationTest.java
@@ -37,12 +37,6 @@ public class EmbeddedActiveMQResourceCustomConfigurationTest {
static final String TEST_QUEUE = "test.queue";
static final String TEST_ADDRESS = "test.address";
- static {
- ThreadLeakCheckRule.addKownThread("MemoryPoolMXBean notification dispatcher");
- ThreadLeakCheckRule.addKownThread("threadDeathWatcher");
- ThreadLeakCheckRule.addKownThread("SeedGenerator Thread");
- }
-
CoreQueueConfiguration queueConfiguration = new CoreQueueConfiguration().setAddress(TEST_ADDRESS).setName(TEST_QUEUE);
Configuration customConfiguration = new ConfigurationImpl().setPersistenceEnabled(false).setSecurityEnabled(true).addQueueConfiguration(queueConfiguration);
diff --git a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceFileConfigurationTest.java b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceFileConfigurationTest.java
index 188efda..077049b 100644
--- a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceFileConfigurationTest.java
+++ b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceFileConfigurationTest.java
@@ -33,12 +33,6 @@ public class EmbeddedActiveMQResourceFileConfigurationTest {
static final String TEST_QUEUE = "test.queue";
static final String TEST_ADDRESS = "test.address";
- static {
- ThreadLeakCheckRule.addKownThread("MemoryPoolMXBean notification dispatcher");
- ThreadLeakCheckRule.addKownThread("threadDeathWatcher");
- ThreadLeakCheckRule.addKownThread("SeedGenerator Thread");
- }
-
private EmbeddedActiveMQResource server = new EmbeddedActiveMQResource("embedded-artemis-server.xml");
@Rule
diff --git a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceTest.java b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceTest.java
index 7c7132d..551a970 100644
--- a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceTest.java
+++ b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceTest.java
@@ -27,7 +27,6 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.RuleChain;
-import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
public class EmbeddedActiveMQResourceTest {
@@ -45,9 +44,6 @@ public class EmbeddedActiveMQResourceTest {
TEST_PROPERTIES = new HashMap<String, Object>(2);
TEST_PROPERTIES.put("PropertyOne", "Property Value 1");
TEST_PROPERTIES.put("PropertyTwo", "Property Value 2");
-
- ThreadLeakCheckRule.addKownThread("MemoryPoolMXBean notification dispatcher");
- ThreadLeakCheckRule.addKownThread("threadDeathWatcher");
}
public EmbeddedActiveMQResource server = new EmbeddedActiveMQResource();
@@ -65,13 +61,7 @@ public class EmbeddedActiveMQResourceTest {
@After
public void tearDown() throws Exception {
assertNotNull(String.format(ASSERT_SENT_FORMAT, TEST_ADDRESS), sent);
- Wait.waitFor(new Wait.Condition() {
- @Override
- public boolean isSatisfied() throws Exception {
- return server.getMessageCount(TEST_QUEUE) == 1;
- }
- }, 5000, 100);
- assertEquals(String.format(ASSERT_COUNT_FORMAT, TEST_QUEUE), 1, server.getMessageCount(TEST_QUEUE));
+ Wait.assertEquals(1L, () -> server.getMessageCount(TEST_QUEUE), 30_000, 10);
ClientMessage received = server.receiveMessage(TEST_QUEUE);
assertNotNull(String.format(ASSERT_RECEIVED_FORMAT, TEST_ADDRESS), received);
diff --git a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedJMSResourceMultipleFileConfigurationTest.java b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedJMSResourceMultipleFileConfigurationTest.java
index a5d695b..868f2e4 100644
--- a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedJMSResourceMultipleFileConfigurationTest.java
+++ b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedJMSResourceMultipleFileConfigurationTest.java
@@ -43,12 +43,6 @@ public class EmbeddedJMSResourceMultipleFileConfigurationTest {
static final String ASSERT_PUSHED_FORMAT = "Message should have been pushed a message to %s";
static final String ASSERT_COUNT_FORMAT = "Unexpected message count in destination %s";
- static {
- ThreadLeakCheckRule.addKownThread("MemoryPoolMXBean notification dispatcher");
- ThreadLeakCheckRule.addKownThread("threadDeathWatcher");
- ThreadLeakCheckRule.addKownThread("SeedGenerator Thread");
- }
-
public EmbeddedJMSResource jmsServer = new EmbeddedJMSResource("embedded-artemis-minimal-server.xml", "embedded-artemis-jms-only.xml");
@Rule
diff --git a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedJMSResourceQueueTest.java b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedJMSResourceQueueTest.java
index 8f9c9c3..0db347a 100644
--- a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedJMSResourceQueueTest.java
+++ b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedJMSResourceQueueTest.java
@@ -26,7 +26,6 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.RuleChain;
-import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
public class EmbeddedJMSResourceQueueTest {
@@ -47,10 +46,6 @@ public class EmbeddedJMSResourceQueueTest {
TEST_PROPERTIES = new HashMap<String, Object>(2);
TEST_PROPERTIES.put("PropertyOne", "Property Value 1");
TEST_PROPERTIES.put("PropertyTwo", "Property Value 2");
-
- ThreadLeakCheckRule.addKownThread("MemoryPoolMXBean notification dispatcher");
- ThreadLeakCheckRule.addKownThread("threadDeathWatcher");
- ThreadLeakCheckRule.addKownThread("SeedGenerator Thread");
}
public EmbeddedJMSResource jmsServer = new EmbeddedJMSResource();
@@ -63,13 +58,7 @@ public class EmbeddedJMSResourceQueueTest {
@After
public void tearDown() throws Exception {
assertNotNull(String.format(ASSERT_PUSHED_FORMAT, TEST_DESTINATION_NAME), pushed);
- Wait.waitFor(new Wait.Condition() {
- @Override
- public boolean isSatisfied() throws Exception {
- return jmsServer.getMessageCount(TEST_DESTINATION_NAME) == 1;
- }
- }, 5000, 100);
- assertEquals(String.format(ASSERT_COUNT_FORMAT, TEST_DESTINATION_NAME), 1, jmsServer.getMessageCount(TEST_DESTINATION_NAME));
+ Wait.assertEquals(1L, () -> jmsServer.getMessageCount(TEST_DESTINATION_NAME), (long)30_000, (long)10);
}
@Test
diff --git a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedJMSResourceSingleFileConfigurationTest.java b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedJMSResourceSingleFileConfigurationTest.java
index 7f2a675..3cf0cb5 100644
--- a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedJMSResourceSingleFileConfigurationTest.java
+++ b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedJMSResourceSingleFileConfigurationTest.java
@@ -43,12 +43,6 @@ public class EmbeddedJMSResourceSingleFileConfigurationTest {
static final String ASSERT_PUSHED_FORMAT = "Message should have been pushed a message to %s";
static final String ASSERT_COUNT_FORMAT = "Unexpected message count in destination %s";
- static {
- ThreadLeakCheckRule.addKownThread("MemoryPoolMXBean notification dispatcher");
- ThreadLeakCheckRule.addKownThread("threadDeathWatcher");
- ThreadLeakCheckRule.addKownThread("SeedGenerator Thread");
- }
-
public EmbeddedJMSResource jmsServer = new EmbeddedJMSResource("embedded-artemis-jms-server.xml");
@Rule
diff --git a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedJMSResourceTopicTest.java b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedJMSResourceTopicTest.java
index 0e89de2..af924bf 100644
--- a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedJMSResourceTopicTest.java
+++ b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedJMSResourceTopicTest.java
@@ -33,7 +33,6 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.RuleChain;
-import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
public class EmbeddedJMSResourceTopicTest {
@@ -54,10 +53,6 @@ public class EmbeddedJMSResourceTopicTest {
TEST_PROPERTIES = new HashMap<String, Object>(2);
TEST_PROPERTIES.put("PropertyOne", "Property Value 1");
TEST_PROPERTIES.put("PropertyTwo", "Property Value 2");
-
- ThreadLeakCheckRule.addKownThread("MemoryPoolMXBean notification dispatcher");
- ThreadLeakCheckRule.addKownThread("threadDeathWatcher");
- ThreadLeakCheckRule.addKownThread("SeedGenerator Thread");
}
public EmbeddedJMSResource jmsServer = new EmbeddedJMSResource();
@@ -84,13 +79,7 @@ public class EmbeddedJMSResourceTopicTest {
@After
public void tearDown() throws Exception {
assertNotNull(String.format(ASSERT_PUSHED_FORMAT, TEST_DESTINATION_NAME), pushed);
- Wait.waitFor(new Wait.Condition() {
- @Override
- public boolean isSatisfied() throws Exception {
- return jmsServer.getMessageCount(TEST_DESTINATION_NAME) == 1;
- }
- }, 5000, 100);
- assertEquals(String.format(ASSERT_COUNT_FORMAT, TEST_DESTINATION_NAME), 1, jmsServer.getMessageCount(TEST_DESTINATION_NAME));
+ Wait.assertEquals(1L, () -> jmsServer.getMessageCount(TEST_DESTINATION_NAME), (long)30_000, (long)10);
consumer.close();
session.close();
diff --git a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/MultipleEmbeddedActiveMQResourcesTest.java b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/MultipleEmbeddedActiveMQResourcesTest.java
index b6c5c7d..2f9da05 100644
--- a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/MultipleEmbeddedActiveMQResourcesTest.java
+++ b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/MultipleEmbeddedActiveMQResourcesTest.java
@@ -39,11 +39,6 @@ public class MultipleEmbeddedActiveMQResourcesTest {
static final String ASSERT_RECEIVED_FORMAT = "Message should have been received from %s";
static final String ASSERT_COUNT_FORMAT = "Unexpected message count in queue %s";
- static {
- ThreadLeakCheckRule.addKownThread("MemoryPoolMXBean notification dispatcher");
- ThreadLeakCheckRule.addKownThread("threadDeathWatcher");
- }
-
public EmbeddedActiveMQResource serverOne = new EmbeddedActiveMQResource(0);
public EmbeddedActiveMQResource serverTwo = new EmbeddedActiveMQResource(1);
diff --git a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/MultipleEmbeddedJMSResourcesTest.java b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/MultipleEmbeddedJMSResourcesTest.java
index 2e81724..fe9d175 100644
--- a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/MultipleEmbeddedJMSResourcesTest.java
+++ b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/MultipleEmbeddedJMSResourcesTest.java
@@ -24,7 +24,6 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.RuleChain;
-import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
public class MultipleEmbeddedJMSResourcesTest {
@@ -36,11 +35,6 @@ public class MultipleEmbeddedJMSResourcesTest {
static final String ASSERT_PUSHED_FORMAT = "Message should have been pushed a message to %s";
static final String ASSERT_COUNT_FORMAT = "Unexpected message count in destination %s";
- static {
- ThreadLeakCheckRule.addKownThread("MemoryPoolMXBean notification dispatcher");
- ThreadLeakCheckRule.addKownThread("threadDeathWatcher");
- }
-
public EmbeddedJMSResource jmsServerOne = new EmbeddedJMSResource(0);
public EmbeddedJMSResource jmsServerTwo = new EmbeddedJMSResource(1);
@@ -58,15 +52,8 @@ public class MultipleEmbeddedJMSResourcesTest {
Message pushedTwo = jmsServerTwo.pushMessage(TEST_QUEUE_TWO, TEST_BODY);
assertNotNull(String.format(ASSERT_PUSHED_FORMAT, TEST_QUEUE_TWO), pushedTwo);
-
- Wait.waitFor(new Wait.Condition() {
- @Override
- public boolean isSatisfied() throws Exception {
- return jmsServerOne.getMessageCount(TEST_QUEUE_ONE) == 1 && jmsServerTwo.getMessageCount(TEST_QUEUE_TWO) == 1;
- }
- }, 5000, 100);
- assertEquals(String.format(ASSERT_COUNT_FORMAT, TEST_QUEUE_ONE), 1, jmsServerOne.getMessageCount(TEST_QUEUE_ONE));
- assertEquals(String.format(ASSERT_COUNT_FORMAT, TEST_QUEUE_TWO), 1, jmsServerTwo.getMessageCount(TEST_QUEUE_TWO));
+ Wait.assertEquals(1L, () -> jmsServerOne.getMessageCount(TEST_QUEUE_ONE), 30_000, 10);
+ Wait.assertEquals(1L, () -> jmsServerTwo.getMessageCount(TEST_QUEUE_TWO), 30_000, 10);
}
}
\ No newline at end of file