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

commit d1808050d6b75996429f8363d763cb429af1470a
Author: Otavio Rodolfo Piske <[email protected]>
AuthorDate: Mon May 15 17:07:29 2023 +0200

    (chores) camel-kafka: fix a few unreliable Kafka tests
    
    A few of the Kafka tests do not run reliably with static container 
instances and/or reuse forks, therefore setup a different test execution for 
them
---
 components/camel-kafka/pom.xml                     | 31 +++++++++++++++++++---
 .../integration/KafkaConsumerIdempotentIT.java     |  5 ++++
 .../health/KafkaConsumerBadPortHealthCheckIT.java  |  3 +++
 ...fkaConsumerBadPortSupervisingHealthCheckIT.java |  3 +++
 .../health/KafkaConsumerHealthCheckIT.java         |  3 +++
 .../KafkaConsumerUnresolvableHealthCheckIT.java    |  3 +++
 6 files changed, 44 insertions(+), 4 deletions(-)

diff --git a/components/camel-kafka/pom.xml b/components/camel-kafka/pom.xml
index 52446adae60..e51911d74e8 100644
--- a/components/camel-kafka/pom.xml
+++ b/components/camel-kafka/pom.xml
@@ -150,6 +150,30 @@
                     <skipTests>${skipTests}</skipTests>
                     <reuseForks>true</reuseForks>
                 </configuration>
+                <executions>
+                    <execution>
+                        <id>integration-test</id>
+                        <goals>
+                            <goal>integration-test</goal>
+                        </goals>
+                        <configuration>
+                            <forkCount>1</forkCount>
+                            <reuseForks>true</reuseForks>
+                            <excludedGroups>health,idempotent</excludedGroups>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>serials-test</id>
+                        <goals>
+                            <goal>integration-test</goal>
+                        </goals>
+                        <configuration>
+                            <reuseForks>false</reuseForks>
+                            <groups>health,idempotent</groups>
+                            
<forkedProcessTimeoutInSeconds>600</forkedProcessTimeoutInSeconds>
+                        </configuration>
+                    </execution>
+                </executions>
             </plugin>
         </plugins>
     </build>
@@ -164,10 +188,10 @@
             </properties>
         </profile>
         <profile>
-            <id>arm</id>
+            <id>backwards-compatibility</id>
             <activation>
                 <os>
-                    <arch>!aarch64</arch>
+                    <arch>amd64</arch>
                 </os>
             </activation>
 
@@ -190,11 +214,10 @@
                                     </systemPropertyVariables>
                                     <reuseForks>true</reuseForks>
                                     
<reportNameSuffix>kafka-2</reportNameSuffix>
-                                    
<excludedGroups>non-abstract</excludedGroups>
+                                    
<excludedGroups>non-abstract,health,idempotent</excludedGroups>
                                 </configuration>
                                 <goals>
                                     <goal>integration-test</goal>
-                                    <goal>verify</goal>
                                 </goals>
                             </execution>
                         </executions>
diff --git 
a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/KafkaConsumerIdempotentIT.java
 
b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/KafkaConsumerIdempotentIT.java
index 5874a59b3cf..568db9243f4 100644
--- 
a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/KafkaConsumerIdempotentIT.java
+++ 
b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/KafkaConsumerIdempotentIT.java
@@ -26,12 +26,17 @@ import 
org.apache.camel.processor.idempotent.kafka.KafkaIdempotentRepository;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Tags;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
 import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
 
 import static 
org.apache.camel.component.kafka.serde.KafkaSerdeHelper.numericHeader;
 
 @DisabledIfSystemProperty(named = "enable.kafka.consumer.idempotency.tests", 
matches = "false")
+@Timeout(60)
+@Tags({ @Tag("idempotent") })
 public class KafkaConsumerIdempotentIT extends 
KafkaConsumerIdempotentTestSupport {
 
     public static final String TOPIC = "idempt";
diff --git 
a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/health/KafkaConsumerBadPortHealthCheckIT.java
 
b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/health/KafkaConsumerBadPortHealthCheckIT.java
index d2aa587fdba..4f01504b123 100644
--- 
a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/health/KafkaConsumerBadPortHealthCheckIT.java
+++ 
b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/health/KafkaConsumerBadPortHealthCheckIT.java
@@ -33,6 +33,8 @@ import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.DisplayName;
 import org.junit.jupiter.api.MethodOrderer;
 import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Tags;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.TestInstance;
 import org.junit.jupiter.api.TestMethodOrder;
@@ -46,6 +48,7 @@ import static 
org.testcontainers.shaded.org.awaitility.Awaitility.await;
 @TestInstance(TestInstance.Lifecycle.PER_CLASS)
 @DisabledIfSystemProperty(named = "kafka.instance.type", matches = 
"local-strimzi-container",
                           disabledReason = "Test infra Kafka runs the Strimzi 
containers in a way that conflicts with multiple concurrent images")
+@Tags({ @Tag("health") })
 public class KafkaConsumerBadPortHealthCheckIT extends 
KafkaHealthCheckTestSupport {
     public static final String TOPIC = "test-health";
 
diff --git 
a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/health/KafkaConsumerBadPortSupervisingHealthCheckIT.java
 
b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/health/KafkaConsumerBadPortSupervisingHealthCheckIT.java
index a43cd176c31..8a916af07f2 100644
--- 
a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/health/KafkaConsumerBadPortSupervisingHealthCheckIT.java
+++ 
b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/health/KafkaConsumerBadPortSupervisingHealthCheckIT.java
@@ -35,6 +35,8 @@ import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.DisplayName;
 import org.junit.jupiter.api.MethodOrderer;
 import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Tags;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.TestInstance;
 import org.junit.jupiter.api.TestMethodOrder;
@@ -48,6 +50,7 @@ import static org.awaitility.Awaitility.await;
 @TestInstance(TestInstance.Lifecycle.PER_CLASS)
 @DisabledIfSystemProperty(named = "kafka.instance.type", matches = 
"local-strimzi-container",
                           disabledReason = "Test infra Kafka runs the Strimzi 
containers in a way that conflicts with multiple concurrent images")
+@Tags({ @Tag("health") })
 public class KafkaConsumerBadPortSupervisingHealthCheckIT extends 
KafkaHealthCheckTestSupport {
     public static final String TOPIC = "test-health";
 
diff --git 
a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/health/KafkaConsumerHealthCheckIT.java
 
b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/health/KafkaConsumerHealthCheckIT.java
index 636b1e33d96..f30ccdc0cb6 100644
--- 
a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/health/KafkaConsumerHealthCheckIT.java
+++ 
b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/health/KafkaConsumerHealthCheckIT.java
@@ -42,6 +42,8 @@ import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.DisplayName;
 import org.junit.jupiter.api.MethodOrderer;
 import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Tags;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.TestInstance;
 import org.junit.jupiter.api.TestMethodOrder;
@@ -58,6 +60,7 @@ import static 
org.testcontainers.shaded.org.awaitility.Awaitility.await;
 @Timeout(30)
 @TestInstance(TestInstance.Lifecycle.PER_CLASS)
 @TestMethodOrder(MethodOrderer.OrderAnnotation.class)
+@Tags({ @Tag("health") })
 public class KafkaConsumerHealthCheckIT extends KafkaHealthCheckTestSupport {
     public static final String TOPIC = "test-health";
     public static final String SKIPPED_HEADER_KEY = "CamelSkippedHeader";
diff --git 
a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/health/KafkaConsumerUnresolvableHealthCheckIT.java
 
b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/health/KafkaConsumerUnresolvableHealthCheckIT.java
index 8b330b0055c..78cde477bf2 100644
--- 
a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/health/KafkaConsumerUnresolvableHealthCheckIT.java
+++ 
b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/health/KafkaConsumerUnresolvableHealthCheckIT.java
@@ -31,6 +31,8 @@ import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.DisplayName;
 import org.junit.jupiter.api.MethodOrderer;
 import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Tags;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.TestInstance;
 import org.junit.jupiter.api.TestMethodOrder;
@@ -42,6 +44,7 @@ import static 
org.testcontainers.shaded.org.awaitility.Awaitility.await;
 @TestInstance(TestInstance.Lifecycle.PER_CLASS)
 @DisabledIfSystemProperty(named = "kafka.instance.type", matches = 
"local-strimzi-container",
                           disabledReason = "Test infra Kafka runs the Strimzi 
containers in a way that conflicts with multiple concurrent images")
+@Tags({ @Tag("health") })
 public class KafkaConsumerUnresolvableHealthCheckIT extends 
KafkaHealthCheckTestSupport {
     public static final String TOPIC = "test-health";
 

Reply via email to