This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 03363cd9e15 CAMEL-20113: fixed broken JMS tests (#12507)
03363cd9e15 is described below
commit 03363cd9e1594a70bfa6fb982122c91c79ef7993
Author: Otavio Rodolfo Piske <[email protected]>
AuthorDate: Wed Dec 20 12:22:06 2023 -0300
CAMEL-20113: fixed broken JMS tests (#12507)
---
.../org/apache/camel/component/jms/JmsDeliveryDelayTest.java | 11 ++++++-----
.../apache/camel/component/jms/JmsTopicDurableSharedTest.java | 5 +++++
.../org/apache/camel/component/jms/JmsTopicSharedTest.java | 3 +++
3 files changed, 14 insertions(+), 5 deletions(-)
diff --git
a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsDeliveryDelayTest.java
b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsDeliveryDelayTest.java
index a6205a0f6a0..f7d4e299a36 100644
---
a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsDeliveryDelayTest.java
+++
b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsDeliveryDelayTest.java
@@ -19,8 +19,9 @@ package org.apache.camel.component.jms;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.util.StopWatch;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Tags;
import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.parallel.Isolated;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -31,7 +32,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
* taking a long time to handle this test workload. Nonetheless, it can still
be useful for investigating
* bugs which is why we keep them here.
*/
-@Isolated("These tests are highly susceptible to flakiness as they verify the
results based on duration - which can vary a LOT in loaded systems")
+@Tags({ @Tag("not-parallel") })
public class JmsDeliveryDelayTest extends AbstractPersistentJMSTest {
@Test
@@ -40,7 +41,7 @@ public class JmsDeliveryDelayTest extends
AbstractPersistentJMSTest {
mock.expectedBodiesReceived("Hello World");
StopWatch watch = new StopWatch();
- template.sendBody("activemq:topic:foo?deliveryDelay=1000", "Hello
World");
+
template.sendBody("activemq:topic:JmsDeliveryDelayTest?deliveryDelay=1000",
"Hello World");
MockEndpoint.assertIsSatisfied(context);
assertTrue(watch.taken() >= 1000, "Should take at least 1000 millis");
@@ -49,7 +50,7 @@ public class JmsDeliveryDelayTest extends
AbstractPersistentJMSTest {
@Test
void testInOutWithDelay() {
StopWatch watch = new StopWatch();
- template.requestBody("activemq:topic:foo?deliveryDelay=1000", "Hello
World");
+
template.requestBody("activemq:topic:JmsDeliveryDelayTest?deliveryDelay=1000",
"Hello World");
assertTrue(watch.taken() >= 1000, "Should take at least 1000 millis");
}
@@ -58,7 +59,7 @@ public class JmsDeliveryDelayTest extends
AbstractPersistentJMSTest {
return new RouteBuilder() {
@Override
public void configure() {
- from("activemq:topic:foo")
+ from("activemq:topic:JmsDeliveryDelayTest")
.to("mock:result");
}
};
diff --git
a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsTopicDurableSharedTest.java
b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsTopicDurableSharedTest.java
index 72652a59581..0f2363d1eda 100644
---
a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsTopicDurableSharedTest.java
+++
b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsTopicDurableSharedTest.java
@@ -18,8 +18,13 @@ package org.apache.camel.component.jms;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Tags;
import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
+@Tags({ @Tag("not-parallel") })
+@DisabledIfSystemProperty(named = "ci.env.name", matches = "github.com",
disabledReason = "Flaky on GitHub Actions")
public class JmsTopicDurableSharedTest extends AbstractPersistentJMSTest {
private static final String TEST_DESTINATION_NAME =
"activemq:topic:in.only.topic.consumer.test";
diff --git
a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsTopicSharedTest.java
b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsTopicSharedTest.java
index e07ad096d76..37fb13e91c8 100644
---
a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsTopicSharedTest.java
+++
b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsTopicSharedTest.java
@@ -18,8 +18,11 @@ package org.apache.camel.component.jms;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Tags;
import org.junit.jupiter.api.Test;
+@Tags({ @Tag("not-parallel") })
public class JmsTopicSharedTest extends AbstractPersistentJMSTest {
private static final String TEST_DESTINATION_NAME =
"activemq:topic:in.only.topic.consumer.test";