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/07 15:25:02 UTC
[activemq-artemis] branch master updated: NO-JIRA Fixing
ConcurrentDeliveryCancelTest on extra-tests
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 a461f23 NO-JIRA Fixing ConcurrentDeliveryCancelTest on extra-tests
a461f23 is described below
commit a461f23b32f830e04156b83ce0135fa23135bffb
Author: Clebert Suconic <cl...@apache.org>
AuthorDate: Tue May 7 11:24:53 2019 -0400
NO-JIRA Fixing ConcurrentDeliveryCancelTest on extra-tests
---
.../extras/byteman/ConcurrentDeliveryCancelTest.java | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/ConcurrentDeliveryCancelTest.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/ConcurrentDeliveryCancelTest.java
index 039315c..44150cb 100644
--- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/ConcurrentDeliveryCancelTest.java
+++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/ConcurrentDeliveryCancelTest.java
@@ -61,10 +61,11 @@ public class ConcurrentDeliveryCancelTest extends JMSTestBase {
private static final ReusableLatch latchFlag = new ReusableLatch(1);
public static void enterCancel() {
- latchEnter.countDown();
try {
- latchFlag.await();
- } catch (Exception ignored) {
+ latchEnter.countDown();
+ latchFlag.await(1, TimeUnit.SECONDS);
+ } catch (Throwable ignored) {
+ ignored.printStackTrace();
}
}
@@ -105,7 +106,7 @@ public class ConcurrentDeliveryCancelTest extends JMSTestBase {
String queueName = RandomUtil.randomString();
Queue queue = createQueue(queueName);
- int numberOfMessages = 10000;
+ int numberOfMessages = 100;
{
Connection connection = cf.createConnection();
@@ -122,7 +123,7 @@ public class ConcurrentDeliveryCancelTest extends JMSTestBase {
connection.close();
}
- for (int i = 0; i < 100; i++) {
+ for (int i = 0; i < 10; i++) {
XAConnectionFactory xacf = ActiveMQJMSClient.createConnectionFactory("tcp://localhost:61616", "test");
final XAConnection connection = xacf.createXAConnection();
@@ -152,8 +153,12 @@ public class ConcurrentDeliveryCancelTest extends JMSTestBase {
serverSessions.add(srvSess);
}
}
+ latchFlag.countDown();
+
- resetLatches(2); // from Transactional reaper
+ latchFlag.countUp();
+ latchEnter.countUp();
+ latchEnter.countUp();
List<Thread> threads = new LinkedList<>();
@@ -192,7 +197,7 @@ public class ConcurrentDeliveryCancelTest extends JMSTestBase {
t.start();
}
- Assert.assertTrue(latchEnter.await(10, TimeUnit.MINUTES));
+ latchEnter.await(1, TimeUnit.SECONDS);
latchFlag.countDown();
for (Thread t : threads) {