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 2020/09/15 15:08:27 UTC
[activemq-artemis] branch master updated (e66ec38 -> 1dd901a)
This is an automated email from the ASF dual-hosted git repository.
clebertsuconic pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git.
from e66ec38 This closes #3259
new 27c7385 NO-JIRA using correct queue on RefOperation::rollback and remove TODO
new c0c638d NO-JIRA Fixing intermittent failure on a REST test
new 1dd901a This closes #3262
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../java/org/apache/activemq/artemis/utils/Wait.java | 17 +++++++++++++++++
artemis-rest/pom.xml | 6 ++++++
.../activemq/artemis/rest/test/SelectorTest.java | 19 +++++++------------
.../artemis/core/server/impl/RefsOperation.java | 4 +---
4 files changed, 31 insertions(+), 15 deletions(-)
[activemq-artemis] 02/03: NO-JIRA Fixing intermittent failure on a
REST test
Posted by cl...@apache.org.
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
commit c0c638d61f09c50b50ab8a037505917e346248c3
Author: Clebert Suconic <cl...@apache.org>
AuthorDate: Tue Sep 15 08:56:07 2020 -0400
NO-JIRA Fixing intermittent failure on a REST test
---
.../java/org/apache/activemq/artemis/utils/Wait.java | 17 +++++++++++++++++
artemis-rest/pom.xml | 6 ++++++
.../activemq/artemis/rest/test/SelectorTest.java | 19 +++++++------------
3 files changed, 30 insertions(+), 12 deletions(-)
diff --git a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/Wait.java b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/Wait.java
index ab5826b..85e72bb 100644
--- a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/Wait.java
+++ b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/Wait.java
@@ -39,6 +39,10 @@ public class Wait {
long getCount() throws Exception;
}
+ public interface ObjectCondition {
+ Object getObject() throws Exception;
+ }
+
public interface IntCondition {
int getCount() throws Exception;
}
@@ -47,6 +51,10 @@ public class Wait {
return waitFor(condition, MAX_WAIT_MILLIS);
}
+ public static void assertEquals(Object obj, ObjectCondition condition) throws Exception {
+ assertEquals(obj, condition, MAX_WAIT_MILLIS, SLEEP_MILLIS);
+ }
+
public static void assertEquals(long size, LongCondition condition) throws Exception {
assertEquals(size, condition, MAX_WAIT_MILLIS);
@@ -73,6 +81,15 @@ public class Wait {
assertEquals(size, condition, timeout, SLEEP_MILLIS);
}
+
+ public static void assertEquals(Object obj, ObjectCondition condition, long timeout, long sleepMillis) throws Exception {
+ boolean result = waitFor(() -> (obj == condition || obj.equals(condition.getObject())), timeout, sleepMillis);
+
+ if (!result) {
+ Assert.assertEquals(obj, condition.getObject());
+ }
+ }
+
public static void assertEquals(int size, IntCondition condition, long timeout, long sleepMillis) throws Exception {
boolean result = waitFor(() -> condition.getCount() == size, timeout, sleepMillis);
diff --git a/artemis-rest/pom.xml b/artemis-rest/pom.xml
index 305a284..9d62a30 100644
--- a/artemis-rest/pom.xml
+++ b/artemis-rest/pom.xml
@@ -125,6 +125,12 @@
<version>${project.version}</version>
</dependency>
<dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>artemis-commons</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ </dependency>
+ <dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jms_2.0_spec</artifactId>
</dependency>
diff --git a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/SelectorTest.java b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/SelectorTest.java
index 111d26a..babf995 100644
--- a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/SelectorTest.java
+++ b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/SelectorTest.java
@@ -33,6 +33,7 @@ import org.apache.activemq.artemis.rest.HttpHeaderProperty;
import org.apache.activemq.artemis.rest.queue.push.xml.XmlLink;
import org.apache.activemq.artemis.rest.topic.PushTopicRegistration;
import org.apache.activemq.artemis.rest.topic.TopicDeployment;
+import org.apache.activemq.artemis.utils.Wait;
import org.jboss.logging.Logger;
import org.jboss.resteasy.client.ClientRequest;
import org.jboss.resteasy.client.ClientResponse;
@@ -207,33 +208,27 @@ public class SelectorTest extends MessageTestBase {
order.setName("1");
order.setAmount("$5.00");
publish(prefixedTopicName, order, null, "1");
- Thread.sleep(200);
- Assert.assertEquals(order, PushReceiver.oneOrder);
+ Wait.assertEquals(order, () -> PushReceiver.oneOrder);
order.setName("2");
publish(prefixedTopicName, order, null, "2");
- Thread.sleep(200);
- Assert.assertEquals(order, PushReceiver.twoOrder);
+ Wait.assertEquals(order, () -> PushReceiver.twoOrder);
order.setName("3");
publish(prefixedTopicName, order, null, "2");
- Thread.sleep(200);
- Assert.assertEquals(order, PushReceiver.twoOrder);
+ Wait.assertEquals(order, () -> PushReceiver.twoOrder);
order.setName("4");
publish(prefixedTopicName, order, null, "1");
- Thread.sleep(200);
- Assert.assertEquals(order, PushReceiver.oneOrder);
+ Wait.assertEquals(order, () -> PushReceiver.oneOrder);
order.setName("5");
publish(prefixedTopicName, order, null, "1");
- Thread.sleep(200);
- Assert.assertEquals(order, PushReceiver.oneOrder);
+ Wait.assertEquals(order, () -> PushReceiver.oneOrder);
order.setName("6");
publish(prefixedTopicName, order, null, "1");
- Thread.sleep(200);
- Assert.assertEquals(order, PushReceiver.oneOrder);
+ Wait.assertEquals(order, () -> PushReceiver.oneOrder);
response = oneSubscription.request().delete();
response.releaseConnection();
[activemq-artemis] 03/03: This closes #3262
Posted by cl...@apache.org.
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
commit 1dd901a8e77aeac7ab86029abcfc450f76db0ffe
Merge: e66ec38 c0c638d
Author: Clebert Suconic <cl...@apache.org>
AuthorDate: Tue Sep 15 11:08:16 2020 -0400
This closes #3262
.../java/org/apache/activemq/artemis/utils/Wait.java | 17 +++++++++++++++++
artemis-rest/pom.xml | 6 ++++++
.../activemq/artemis/rest/test/SelectorTest.java | 19 +++++++------------
.../artemis/core/server/impl/RefsOperation.java | 4 +---
4 files changed, 31 insertions(+), 15 deletions(-)
[activemq-artemis] 01/03: NO-JIRA using correct queue on
RefOperation::rollback and remove TODO
Posted by cl...@apache.org.
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
commit 27c7385315f101f0d3af29745ef4364d8e032e09
Author: Clebert Suconic <cl...@apache.org>
AuthorDate: Tue Sep 15 08:12:57 2020 -0400
NO-JIRA using correct queue on RefOperation::rollback and remove TODO
this does not represent an issue as there are no semantic changes here.
I am doing this for correctness
---
.../org/apache/activemq/artemis/core/server/impl/RefsOperation.java | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/RefsOperation.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/RefsOperation.java
index 355bcd9..552c190 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/RefsOperation.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/RefsOperation.java
@@ -138,15 +138,13 @@ public class RefsOperation extends TransactionOperationAbstract {
if (durableRefCount == 1) {
storageManager.storeMessageTransactional(ackedTX.getID(), message);
}
- Queue queue = ref.getQueue();
storageManager.storeReferenceTransactional(ackedTX.getID(), queue.getID(), message.getMessageID());
ackedTX.setContainsPersistent();
}
- // TODO-NOW: THIS MUST BE SOLVED BEFORE MERGED, DO NOT LET ME COMMIT THIS WITHOUT REVIEW
- queue.refUp(message);
+ ref.getQueue().refUp(message);
}
ackedTX.commit(true);
} catch (Exception e) {