You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2023/12/24 16:17:06 UTC
(camel) branch main updated: CAMEL-20276: fixing jms shared topic tests (#12580)
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 5c031d5f390 CAMEL-20276: fixing jms shared topic tests (#12580)
5c031d5f390 is described below
commit 5c031d5f390400a9ba49cdd49f478c60d708bae9
Author: Ivan Kulaga <ku...@gmail.com>
AuthorDate: Sun Dec 24 19:17:00 2023 +0300
CAMEL-20276: fixing jms shared topic tests (#12580)
* it seems that sometimes publication happens before Artemis finishes creating consumers
* waiting for the context to be up
---
.../camel/component/jms/JmsTopicDurableSharedTest.java | 14 +++++++++-----
.../org/apache/camel/component/jms/JmsTopicSharedTest.java | 12 +++++++++---
2 files changed, 18 insertions(+), 8 deletions(-)
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 77d47c6bf2e..4b634420229 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
@@ -16,20 +16,24 @@
*/
package org.apache.camel.component.jms;
+import org.apache.camel.ContextEvents;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.jupiter.api.Disabled;
+import org.awaitility.Awaitility;
+import org.junit.jupiter.api.BeforeEach;
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")
-@Disabled("Disabled due to CAMEL-20276")
public class JmsTopicDurableSharedTest extends AbstractPersistentJMSTest {
- private static final String TEST_DESTINATION_NAME = "activemq:topic:in.only.topic.consumer.test";
+ private static final String TEST_DESTINATION_NAME = "activemq:topic:in.only.topic.shared.durable.test";
+
+ @BeforeEach
+ void waitForArtemisToFinishCreatingConsumers() {
+ Awaitility.await().until(() -> context.getClock().get(ContextEvents.START).elapsed() > 1000);
+ }
@Test
void testDurableSharedTopic() throws Exception {
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 de367456860..f55d51aa23c 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
@@ -16,18 +16,24 @@
*/
package org.apache.camel.component.jms;
+import org.apache.camel.ContextEvents;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.jupiter.api.Disabled;
+import org.awaitility.Awaitility;
+import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Tags;
import org.junit.jupiter.api.Test;
@Tags({ @Tag("not-parallel") })
-@Disabled("Disabled due to CAMEL-20276")
public class JmsTopicSharedTest extends AbstractPersistentJMSTest {
- private static final String TEST_DESTINATION_NAME = "activemq:topic:in.only.topic.consumer.test";
+ private static final String TEST_DESTINATION_NAME = "activemq:topic:in.only.topic.shared.test";
+
+ @BeforeEach
+ void waitForArtemisToFinishCreatingConsumers() {
+ Awaitility.await().until(() -> context.getClock().get(ContextEvents.START).elapsed() > 1000);
+ }
@Test
void testSharedTopic() throws Exception {