From 68a43734ef2b2e726351efb3991a1b84ca81f7de Mon Sep 17 00:00:00 2001 From: Otavio Rodolfo Piske Date: Wed, 29 May 2024 10:06:06 +0200 Subject: [PATCH 1/4] (chores) camel-couchbase: cleanup disabling resource-intensive tests --- .../integration/ConsumeMessagesWithLimitIT.java | 10 ++-------- .../couchbase/integration/ConsumeResumeStrategyIT.java | 10 ++-------- .../couchbase/integration/ProduceMessagesSimpleIT.java | 10 ++-------- .../integration/ProduceMessagesWithAutoIDIT.java | 10 ++-------- .../couchbase/integration/RemoveMessagesIT.java | 10 ++-------- 5 files changed, 10 insertions(+), 40 deletions(-) diff --git a/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/integration/ConsumeMessagesWithLimitIT.java b/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/integration/ConsumeMessagesWithLimitIT.java index 8fc06cabd9845..2d28de1bf5fe2 100644 --- a/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/integration/ConsumeMessagesWithLimitIT.java +++ b/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/integration/ConsumeMessagesWithLimitIT.java @@ -25,16 +25,10 @@ import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Tags; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledIfSystemProperties; import org.junit.jupiter.api.condition.DisabledIfSystemProperty; -@DisabledIfSystemProperties({ - @DisabledIfSystemProperty(named = "ci.env.name", matches = "apache.org", - disabledReason = "Apache CI nodes are too resource constrained for this test"), - @DisabledIfSystemProperty(named = "ci.env.name", matches = "github.com", disabledReason = "Flaky on GitHub Actions"), - @DisabledIfSystemProperty(named = "couchbase.enable.it", matches = "false", - disabledReason = "Too resource intensive for most systems to run reliably"), -}) +@DisabledIfSystemProperty(named = "ci.env.name", matches = ".*", + disabledReason = "Too resource intensive for most systems to run reliably") @Tags({ @Tag("couchbase-71") }) public class ConsumeMessagesWithLimitIT extends CouchbaseIntegrationTestBase { diff --git a/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/integration/ConsumeResumeStrategyIT.java b/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/integration/ConsumeResumeStrategyIT.java index 899b87458c58a..7236ae97b541f 100644 --- a/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/integration/ConsumeResumeStrategyIT.java +++ b/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/integration/ConsumeResumeStrategyIT.java @@ -32,19 +32,13 @@ import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Tags; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledIfSystemProperties; import org.junit.jupiter.api.condition.DisabledIfSystemProperty; import static org.apache.camel.component.couchbase.CouchbaseConstants.COUCHBASE_RESUME_ACTION; import static org.awaitility.Awaitility.await; -@DisabledIfSystemProperties({ - @DisabledIfSystemProperty(named = "ci.env.name", matches = "apache.org", - disabledReason = "Apache CI nodes are too resource constrained for this test"), - @DisabledIfSystemProperty(named = "ci.env.name", matches = "github.com", disabledReason = "Flaky on GitHub Actions"), - @DisabledIfSystemProperty(named = "couchbase.enable.it", matches = "false", - disabledReason = "Too resource intensive for most systems to run reliably"), -}) +@DisabledIfSystemProperty(named = "ci.env.name", matches = ".*", + disabledReason = "Too resource intensive for most systems to run reliably") @Tags({ @Tag("couchbase-71") }) public class ConsumeResumeStrategyIT extends CouchbaseIntegrationTestBase { static class TestCouchbaseResumeAdapter implements ResumeActionAware { diff --git a/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/integration/ProduceMessagesSimpleIT.java b/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/integration/ProduceMessagesSimpleIT.java index 690c17a8d6e9c..1a44fe0382e0b 100644 --- a/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/integration/ProduceMessagesSimpleIT.java +++ b/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/integration/ProduceMessagesSimpleIT.java @@ -22,16 +22,10 @@ import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Tags; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledIfSystemProperties; import org.junit.jupiter.api.condition.DisabledIfSystemProperty; -@DisabledIfSystemProperties({ - @DisabledIfSystemProperty(named = "ci.env.name", matches = "apache.org", - disabledReason = "Apache CI nodes are too resource constrained for this test"), - @DisabledIfSystemProperty(named = "ci.env.name", matches = "github.com", disabledReason = "Flaky on GitHub Actions"), - @DisabledIfSystemProperty(named = "couchbase.enable.it", matches = "false", - disabledReason = "Too resource intensive for most systems to run reliably"), -}) +@DisabledIfSystemProperty(named = "ci.env.name", matches = ".*", + disabledReason = "Too resource intensive for most systems to run reliably") @Tags({ @Tag("couchbase-7") }) public class ProduceMessagesSimpleIT extends CouchbaseIntegrationTestBase { diff --git a/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/integration/ProduceMessagesWithAutoIDIT.java b/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/integration/ProduceMessagesWithAutoIDIT.java index 516db0aabfdf6..6bfc317154c4b 100644 --- a/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/integration/ProduceMessagesWithAutoIDIT.java +++ b/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/integration/ProduceMessagesWithAutoIDIT.java @@ -21,16 +21,10 @@ import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Tags; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledIfSystemProperties; import org.junit.jupiter.api.condition.DisabledIfSystemProperty; -@DisabledIfSystemProperties({ - @DisabledIfSystemProperty(named = "ci.env.name", matches = "apache.org", - disabledReason = "Apache CI nodes are too resource constrained for this test"), - @DisabledIfSystemProperty(named = "ci.env.name", matches = "github.com", disabledReason = "Flaky on GitHub Actions"), - @DisabledIfSystemProperty(named = "couchbase.enable.it", matches = "false", - disabledReason = "Too resource intensive for most systems to run reliably"), -}) +@DisabledIfSystemProperty(named = "ci.env.name", matches = ".*", + disabledReason = "Too resource intensive for most systems to run reliably") @Tags({ @Tag("couchbase-7") }) public class ProduceMessagesWithAutoIDIT extends CouchbaseIntegrationTestBase { diff --git a/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/integration/RemoveMessagesIT.java b/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/integration/RemoveMessagesIT.java index 420682cd05cc7..a84f5bba6a1c4 100644 --- a/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/integration/RemoveMessagesIT.java +++ b/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/integration/RemoveMessagesIT.java @@ -22,19 +22,13 @@ import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Tags; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledIfSystemProperties; import org.junit.jupiter.api.condition.DisabledIfSystemProperty; import static org.apache.camel.component.couchbase.CouchbaseConstants.COUCHBASE_DELETE; import static org.apache.camel.component.couchbase.CouchbaseConstants.HEADER_ID; -@DisabledIfSystemProperties({ - @DisabledIfSystemProperty(named = "ci.env.name", matches = "apache.org", - disabledReason = "Apache CI nodes are too resource constrained for this test"), - @DisabledIfSystemProperty(named = "ci.env.name", matches = "github.com", disabledReason = "Flaky on GitHub Actions"), - @DisabledIfSystemProperty(named = "couchbase.enable.it", matches = "false", - disabledReason = "Too resource intensive for most systems to run reliably"), -}) +@DisabledIfSystemProperty(named = "ci.env.name", matches = ".*", + disabledReason = "Too resource intensive for most systems to run reliably") @Tags({ @Tag("couchbase-7") }) public class RemoveMessagesIT extends CouchbaseIntegrationTestBase { From c811880ac2acdc89c10aa16ad989e7607643dab3 Mon Sep 17 00:00:00 2001 From: Otavio Rodolfo Piske Date: Wed, 29 May 2024 10:36:43 +0200 Subject: [PATCH 2/4] (chores) camel-aws2-eventbridge: avoid singleton containers for some tests --- .../localstack/EventbridgePutEventsIT.java | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/components/camel-aws/camel-aws2-eventbridge/src/test/java/org/apache/camel/component/aws2/eventbridge/localstack/EventbridgePutEventsIT.java b/components/camel-aws/camel-aws2-eventbridge/src/test/java/org/apache/camel/component/aws2/eventbridge/localstack/EventbridgePutEventsIT.java index 0c8012ac23ebd..3266719aa2e75 100644 --- a/components/camel-aws/camel-aws2-eventbridge/src/test/java/org/apache/camel/component/aws2/eventbridge/localstack/EventbridgePutEventsIT.java +++ b/components/camel-aws/camel-aws2-eventbridge/src/test/java/org/apache/camel/component/aws2/eventbridge/localstack/EventbridgePutEventsIT.java @@ -16,18 +16,28 @@ */ package org.apache.camel.component.aws2.eventbridge.localstack; +import org.apache.camel.CamelContext; import org.apache.camel.EndpointInject; import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.apache.camel.ProducerTemplate; import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.aws2.eventbridge.EventbridgeComponent; import org.apache.camel.component.aws2.eventbridge.EventbridgeConstants; import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.test.infra.aws.common.services.AWSService; +import org.apache.camel.test.infra.aws2.clients.AWSSDKClientUtils; +import org.apache.camel.test.infra.aws2.services.AWSServiceFactory; +import org.apache.camel.test.junit5.CamelTestSupport; import org.junit.Assert; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; import software.amazon.awssdk.services.eventbridge.model.PutEventsResponse; -public class EventbridgePutEventsIT extends Aws2EventbridgeBase { +public class EventbridgePutEventsIT extends CamelTestSupport { + + @RegisterExtension + public static AWSService service = AWSServiceFactory.createEventBridgeService(); @EndpointInject private ProducerTemplate template; @@ -35,6 +45,14 @@ public class EventbridgePutEventsIT extends Aws2EventbridgeBase { @EndpointInject("mock:result") private MockEndpoint result; + @Override + protected CamelContext createCamelContext() throws Exception { + CamelContext context = super.createCamelContext(); + EventbridgeComponent eventbridgeComponent = context.getComponent("aws2-eventbridge", EventbridgeComponent.class); + eventbridgeComponent.getConfiguration().setEventbridgeClient(AWSSDKClientUtils.newEventBridgeClient()); + return context; + } + @Test public void sendIn() throws Exception { result.expectedMessageCount(1); From d48a53e66457703dc711712193653d7c3442d084 Mon Sep 17 00:00:00 2001 From: Otavio Rodolfo Piske Date: Wed, 29 May 2024 10:45:14 +0200 Subject: [PATCH 3/4] (chores) camel-sjms: isolate a few flaky tests --- .../org/apache/camel/component/sjms/ReconnectConsumerTest.java | 2 ++ .../apache/camel/component/sjms/ReconnectInOutProducerTest.java | 2 ++ .../org/apache/camel/component/sjms/ReconnectProducerTest.java | 2 ++ 3 files changed, 6 insertions(+) diff --git a/components/camel-sjms/src/test/java/org/apache/camel/component/sjms/ReconnectConsumerTest.java b/components/camel-sjms/src/test/java/org/apache/camel/component/sjms/ReconnectConsumerTest.java index 7a876b5874efe..39b64481ca675 100644 --- a/components/camel-sjms/src/test/java/org/apache/camel/component/sjms/ReconnectConsumerTest.java +++ b/components/camel-sjms/src/test/java/org/apache/camel/component/sjms/ReconnectConsumerTest.java @@ -24,9 +24,11 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.DisabledIfSystemProperty; import org.junit.jupiter.api.extension.RegisterExtension; +import org.junit.jupiter.api.parallel.Isolated; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@Isolated("Seems to have problem running along with other tests") @DisabledIfSystemProperty(named = "activemq.instance.type", matches = "remote", disabledReason = "Requires control of ActiveMQ, so it can only run locally (embedded or container)") public class ReconnectConsumerTest extends JmsExclusiveTestSupport { diff --git a/components/camel-sjms/src/test/java/org/apache/camel/component/sjms/ReconnectInOutProducerTest.java b/components/camel-sjms/src/test/java/org/apache/camel/component/sjms/ReconnectInOutProducerTest.java index 4d1c13ddbe485..7b443bae9f465 100644 --- a/components/camel-sjms/src/test/java/org/apache/camel/component/sjms/ReconnectInOutProducerTest.java +++ b/components/camel-sjms/src/test/java/org/apache/camel/component/sjms/ReconnectInOutProducerTest.java @@ -31,12 +31,14 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.DisabledIfSystemProperty; import org.junit.jupiter.api.extension.RegisterExtension; +import org.junit.jupiter.api.parallel.Isolated; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; +@Isolated("Seems to have problem running along with other tests") @DisabledIfSystemProperty(named = "activemq.instance.type", matches = "remote", disabledReason = "Requires control of ActiveMQ, so it can only run locally (embedded or container)") public class ReconnectInOutProducerTest extends JmsExclusiveTestSupport { diff --git a/components/camel-sjms/src/test/java/org/apache/camel/component/sjms/ReconnectProducerTest.java b/components/camel-sjms/src/test/java/org/apache/camel/component/sjms/ReconnectProducerTest.java index e58fefbb208a2..4b12badaa8854 100644 --- a/components/camel-sjms/src/test/java/org/apache/camel/component/sjms/ReconnectProducerTest.java +++ b/components/camel-sjms/src/test/java/org/apache/camel/component/sjms/ReconnectProducerTest.java @@ -28,10 +28,12 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.DisabledIfSystemProperty; import org.junit.jupiter.api.extension.RegisterExtension; +import org.junit.jupiter.api.parallel.Isolated; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; +@Isolated("Seems to have problem running along with other tests") @DisabledIfSystemProperty(named = "activemq.instance.type", matches = "remote", disabledReason = "Requires control of ActiveMQ, so it can only run locally (embedded or container)") public class ReconnectProducerTest extends JmsExclusiveTestSupport { From 1ab7d992e54fc0d4ca37b3e3b60bf9e54d4ceff4 Mon Sep 17 00:00:00 2001 From: Otavio Rodolfo Piske Date: Wed, 29 May 2024 10:50:29 +0200 Subject: [PATCH 4/4] CAMEL-20722: disable flaky camel-kafka tests --- .../integration/KafkaBreakOnFirstErrorReleaseResourcesIT.java | 3 +++ .../kafka/integration/KafkaBreakOnFirstErrorSeekIssueIT.java | 3 +++ ...fkaBreakOnFirstErrorWithBatchUsingAsyncCommitManagerIT.java | 3 +++ 3 files changed, 9 insertions(+) diff --git a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/KafkaBreakOnFirstErrorReleaseResourcesIT.java b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/KafkaBreakOnFirstErrorReleaseResourcesIT.java index 024d6714bcf87..1424e03cec99f 100644 --- a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/KafkaBreakOnFirstErrorReleaseResourcesIT.java +++ b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/KafkaBreakOnFirstErrorReleaseResourcesIT.java @@ -32,6 +32,7 @@ import org.apache.kafka.clients.producer.ProducerRecord; import org.awaitility.Awaitility; import org.junit.jupiter.api.*; +import org.junit.jupiter.api.condition.DisabledIfSystemProperty; import org.junit.jupiter.api.condition.EnabledOnOs; import org.junit.jupiter.api.condition.OS; import org.slf4j.Logger; @@ -49,6 +50,8 @@ @EnabledOnOs(value = { OS.LINUX, OS.MAC, OS.FREEBSD, OS.OPENBSD, OS.WINDOWS }, architectures = { "amd64", "aarch64" }, disabledReason = "This test does not run reliably on some platforms") +@DisabledIfSystemProperty(named = "ci.env.name", matches = ".*", + disabledReason = "CAMEL-20722: Too unreliable on most of the CI environments") class KafkaBreakOnFirstErrorReleaseResourcesIT extends BaseKafkaTestSupport { public static final String ROUTE_ID = "breakOnFirstError-20563" + Thread.currentThread().hashCode(); //CAMEL-20722 - added for similar reason as CAMEL-20686: diff --git a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/KafkaBreakOnFirstErrorSeekIssueIT.java b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/KafkaBreakOnFirstErrorSeekIssueIT.java index 78b3a9900b94c..d7d715872c389 100644 --- a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/KafkaBreakOnFirstErrorSeekIssueIT.java +++ b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/KafkaBreakOnFirstErrorSeekIssueIT.java @@ -37,6 +37,7 @@ 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; import org.junit.jupiter.api.condition.EnabledOnOs; import org.junit.jupiter.api.condition.OS; import org.slf4j.Logger; @@ -54,6 +55,8 @@ @EnabledOnOs(value = { OS.LINUX, OS.MAC, OS.FREEBSD, OS.OPENBSD, OS.WINDOWS }, architectures = { "amd64", "aarch64" }, disabledReason = "This test does not run reliably on some platforms") +@DisabledIfSystemProperty(named = "ci.env.name", matches = ".*", + disabledReason = "CAMEL-20722: Too unreliable on most of the CI environments") class KafkaBreakOnFirstErrorSeekIssueIT extends BaseExclusiveKafkaTestSupport { public static final String ROUTE_ID = "breakOnFirstError-19894"; diff --git a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/KafkaBreakOnFirstErrorWithBatchUsingAsyncCommitManagerIT.java b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/KafkaBreakOnFirstErrorWithBatchUsingAsyncCommitManagerIT.java index 17abc4e556034..10b96fad61fea 100644 --- a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/KafkaBreakOnFirstErrorWithBatchUsingAsyncCommitManagerIT.java +++ b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/KafkaBreakOnFirstErrorWithBatchUsingAsyncCommitManagerIT.java @@ -35,6 +35,7 @@ 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; import org.junit.jupiter.api.condition.EnabledOnOs; import org.junit.jupiter.api.condition.OS; import org.slf4j.Logger; @@ -50,6 +51,8 @@ @EnabledOnOs(value = { OS.LINUX, OS.MAC, OS.FREEBSD, OS.OPENBSD, OS.WINDOWS }, architectures = { "amd64", "aarch64" }, disabledReason = "This test does not run reliably on some platforms") +@DisabledIfSystemProperty(named = "ci.env.name", matches = ".*", + disabledReason = "CAMEL-20722: Too unreliable on most of the CI environments") class KafkaBreakOnFirstErrorWithBatchUsingAsyncCommitManagerIT extends BaseExclusiveKafkaTestSupport { public static final String ROUTE_ID = "breakOnFirstErrorBatchIT"; public static final String TOPIC = "breakOnFirstErrorBatchIT";