You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2022/11/01 12:56:22 UTC

[camel-quarkus] branch quarkus-main updated (f19eb8f566 -> 58057cc4f1)

This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a change to branch quarkus-main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git


 discard f19eb8f566 Disable microprofile-fault-tolerance testing due to #4225
     new 58057cc4f1 Disable microprofile-fault-tolerance testing due to #4225

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (f19eb8f566)
            \
             N -- N -- N   refs/heads/quarkus-main (58057cc4f1)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 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:
 .../faulttolerance/MicroProfileFaultToleranceRoutes.java | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)


[camel-quarkus] 01/01: Disable microprofile-fault-tolerance testing due to #4225

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch quarkus-main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit 58057cc4f16c5c73f076a4ef2c30741c69a83a2e
Author: James Netherton <ja...@gmail.com>
AuthorDate: Mon Oct 31 08:56:00 2022 +0000

    Disable microprofile-fault-tolerance testing due to #4225
---
 .../it/CoreFaultToleranceProducers.java            | 35 ++++++++++++++++++++--
 integration-tests/foundation-grouped/pom.xml       |  6 +++-
 integration-tests/microprofile/pom.xml             |  2 ++
 .../MicroProfileFaultToleranceRoutes.java          | 20 ++++++-------
 .../MicroprofileFaultToleranceIT.java              |  2 ++
 .../MicroprofileFaultToleranceTest.java            |  2 ++
 tooling/scripts/group-tests.groovy                 |  6 +++-
 7 files changed, 58 insertions(+), 15 deletions(-)

diff --git a/integration-test-groups/foundation/core-fault-tolerance/src/main/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceProducers.java b/integration-test-groups/foundation/core-fault-tolerance/src/main/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceProducers.java
index aa9394108c..67f580041d 100644
--- a/integration-test-groups/foundation/core-fault-tolerance/src/main/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceProducers.java
+++ b/integration-test-groups/foundation/core-fault-tolerance/src/main/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceProducers.java
@@ -18,29 +18,32 @@ package org.apache.camel.quarkus.core.faulttolerance.it;
 
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
 
 import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Disposes;
 import javax.inject.Named;
 
 import io.smallrye.faulttolerance.core.FaultToleranceStrategy;
 import io.smallrye.faulttolerance.core.InvocationContext;
 import io.smallrye.faulttolerance.core.circuit.breaker.CircuitBreaker;
 import io.smallrye.faulttolerance.core.stopwatch.SystemStopwatch;
+import io.smallrye.faulttolerance.core.timer.ThreadTimer;
 import io.smallrye.faulttolerance.core.util.ExceptionDecision;
 
 public class CoreFaultToleranceProducers {
 
     @ApplicationScoped
     @Named("customCircuitBreaker")
-    CircuitBreaker<Integer> produceCustomCircuitBreaker() {
+    CircuitBreaker<Integer> produceCustomCircuitBreaker(ThreadTimer threadTimer) {
         FaultToleranceStrategy<Integer> delegate = new FaultToleranceStrategy<Integer>() {
             @Override
             public Integer apply(InvocationContext<Integer> ctx) {
                 return null;
             }
         };
-        return new CircuitBreaker<Integer>(delegate, "description", ExceptionDecision.ALWAYS_FAILURE, 10, 40, 0.1,
-                2, new SystemStopwatch()) {
+        return new CircuitBreaker<>(delegate, "description", ExceptionDecision.ALWAYS_FAILURE, 10, 40, 0.1,
+                2, SystemStopwatch.INSTANCE, threadTimer) {
             @Override
             public String toString() {
                 return "customCircuitBreaker";
@@ -54,4 +57,30 @@ public class CoreFaultToleranceProducers {
         return Executors.newFixedThreadPool(2);
     }
 
+    @ApplicationScoped
+    @Named("threadTimer")
+    ThreadTimer threadTimer(@Named("threadTimerExecutor") ExecutorService executorService) {
+        return new ThreadTimer(executorService);
+    }
+
+    @ApplicationScoped
+    @Named("threadTimerExecutor")
+    ExecutorService threadTimerExecutor() {
+        return Executors.newSingleThreadExecutor();
+    }
+
+    void disposeThreadTimerExecutor(@Disposes @Named("threadTimerExecutor") ExecutorService threadTimerExecutor,
+            ThreadTimer timer) {
+        try {
+            timer.shutdown();
+        } catch (InterruptedException e) {
+            Thread.currentThread().interrupt();
+        }
+
+        try {
+            threadTimerExecutor.awaitTermination(10, TimeUnit.SECONDS);
+        } catch (InterruptedException e) {
+            Thread.currentThread().interrupt();
+        }
+    }
 }
diff --git a/integration-tests/foundation-grouped/pom.xml b/integration-tests/foundation-grouped/pom.xml
index 51f2d09ee1..b11a115073 100644
--- a/integration-tests/foundation-grouped/pom.xml
+++ b/integration-tests/foundation-grouped/pom.xml
@@ -96,10 +96,12 @@
             <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-log</artifactId>
         </dependency>
+        <!-- https://github.com/apache/camel-quarkus/issues/4225
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-microprofile-fault-tolerance</artifactId>
         </dependency>
+        -->
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-mock</artifactId>
@@ -210,7 +212,9 @@
                             <properties>
                                 <group-tests.source.dir>${maven.multiModuleProjectDirectory}/integration-test-groups/foundation</group-tests.source.dir>
                                 <group-tests.dest.module.dir>${project.basedir}</group-tests.dest.module.dir>
-                                <group-tests.concat.rel.paths>src/main/resources/application.properties</group-tests.concat.rel.paths>
+				<group-tests.concat.rel.paths>src/main/resources/application.properties</group-tests.concat.rel.paths>
+				<!-- TODO: https://github.com/apache/camel-quarkus/issues/4225 -->
+				<group-tests.files.excludes>core-fault-tolerance</group-tests.files.excludes>
                             </properties>
                         </configuration>
                     </execution>
diff --git a/integration-tests/microprofile/pom.xml b/integration-tests/microprofile/pom.xml
index 9e50efc805..f77c2183c0 100644
--- a/integration-tests/microprofile/pom.xml
+++ b/integration-tests/microprofile/pom.xml
@@ -84,6 +84,7 @@
 
 
     <profiles>
+        <!-- TODO: https://github.com/apache/camel-quarkus/issues/4225
         <profile>
             <id>native</id>
             <activation>
@@ -111,6 +112,7 @@
                 </plugins>
             </build>
         </profile>
+        -->
         <profile>
             <id>virtualDependencies</id>
             <activation>
diff --git a/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroProfileFaultToleranceRoutes.java b/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroProfileFaultToleranceRoutes.java
index 2ac31d6d3e..f6a07977d4 100644
--- a/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroProfileFaultToleranceRoutes.java
+++ b/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroProfileFaultToleranceRoutes.java
@@ -17,14 +17,12 @@
 package org.apache.camel.quarkus.component.microprofile.it.faulttolerance;
 
 import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.atomic.AtomicInteger;
 
 import javax.enterprise.context.ApplicationScoped;
 import javax.inject.Inject;
 import javax.inject.Named;
 
 import org.apache.camel.builder.RouteBuilder;
-import org.eclipse.microprofile.faulttolerance.exceptions.TimeoutException;
 
 @ApplicationScoped
 public class MicroProfileFaultToleranceRoutes extends RouteBuilder {
@@ -38,6 +36,7 @@ public class MicroProfileFaultToleranceRoutes extends RouteBuilder {
 
     @Override
     public void configure() throws Exception {
+        /* TODO: https://github.com/apache/camel-quarkus/issues/4225
         from("direct:faultToleranceWithBulkhead")
                 .circuitBreaker()
                 .faultToleranceConfiguration().bulkheadEnabled(true).end()
@@ -51,7 +50,7 @@ public class MicroProfileFaultToleranceRoutes extends RouteBuilder {
                 .onFallback()
                 .setBody().constant(FALLBACK_RESULT)
                 .end();
-
+        
         from("direct:faultToleranceWithFallback")
                 .circuitBreaker()
                 .process(exchange -> {
@@ -64,7 +63,7 @@ public class MicroProfileFaultToleranceRoutes extends RouteBuilder {
                 .onFallback()
                 .setBody().constant(FALLBACK_RESULT)
                 .end();
-
+        
         from("direct:faultToleranceWithThreshold")
                 .circuitBreaker()
                 .faultToleranceConfiguration().failureRatio(100).successThreshold(1).requestVolumeThreshold(1).delay(0).end()
@@ -77,7 +76,7 @@ public class MicroProfileFaultToleranceRoutes extends RouteBuilder {
                 })
                 .end()
                 .setBody().simple(RESULT);
-
+        
         from("direct:faultToleranceWithTimeout")
                 .circuitBreaker()
                 .faultToleranceConfiguration().timeoutEnabled(true).timeoutDuration(500).end()
@@ -91,7 +90,7 @@ public class MicroProfileFaultToleranceRoutes extends RouteBuilder {
                 .onFallback()
                 .setBody().simple(FALLBACK_RESULT)
                 .end();
-
+        
         from("direct:faultToleranceWithTimeoutCustomExecutor")
                 .circuitBreaker()
                 .faultToleranceConfiguration().timeoutEnabled(true).timeoutScheduledExecutorService("myThreadPool")
@@ -106,26 +105,27 @@ public class MicroProfileFaultToleranceRoutes extends RouteBuilder {
                 .onFallback()
                 .setBody().simple(FALLBACK_RESULT)
                 .end();
-
+        
         from("direct:inheritErrorHandler")
                 .errorHandler(deadLetterChannel("mock:dead").maximumRedeliveries(3).redeliveryDelay(0))
                 .circuitBreaker().inheritErrorHandler(true)
                 .to("mock:start")
                 .throwException(new IllegalArgumentException(EXCEPTION_MESSAGE)).end()
                 .to("mock:end");
-
+        
         from("direct:circuitBreakerBean")
                 .bean(greetingBean, "greetWithCircuitBreaker");
-
+        
         from("direct:fallbackBean")
                 .bean(greetingBean, "greetWithFallback");
-
+        
         from("direct:timeoutBean")
                 .doTry()
                 .bean(greetingBean, "greetWithDelay")
                 .doCatch(TimeoutException.class)
                 .setBody().constant(FALLBACK_RESULT)
                 .end();
+         */
     }
 
     @Named("myThreadPool")
diff --git a/integration-tests/microprofile/src/test/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroprofileFaultToleranceIT.java b/integration-tests/microprofile/src/test/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroprofileFaultToleranceIT.java
index 1362ada770..dad557b45b 100644
--- a/integration-tests/microprofile/src/test/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroprofileFaultToleranceIT.java
+++ b/integration-tests/microprofile/src/test/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroprofileFaultToleranceIT.java
@@ -17,7 +17,9 @@
 package org.apache.camel.quarkus.component.microprofile.it.faulttolerance;
 
 import io.quarkus.test.junit.QuarkusIntegrationTest;
+import org.junit.jupiter.api.Disabled;
 
+@Disabled("https://github.com/apache/camel-quarkus/issues/4225")
 @QuarkusIntegrationTest
 class MicroprofileFaultToleranceIT extends MicroprofileFaultToleranceTest {
 
diff --git a/integration-tests/microprofile/src/test/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroprofileFaultToleranceTest.java b/integration-tests/microprofile/src/test/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroprofileFaultToleranceTest.java
index 4d5378c12a..27de01642e 100644
--- a/integration-tests/microprofile/src/test/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroprofileFaultToleranceTest.java
+++ b/integration-tests/microprofile/src/test/java/org/apache/camel/quarkus/component/microprofile/it/faulttolerance/MicroprofileFaultToleranceTest.java
@@ -18,6 +18,7 @@ package org.apache.camel.quarkus.component.microprofile.it.faulttolerance;
 
 import io.quarkus.test.junit.QuarkusTest;
 import io.restassured.RestAssured;
+import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.MethodSource;
@@ -26,6 +27,7 @@ import org.junit.jupiter.params.provider.ValueSource;
 import static org.apache.camel.quarkus.component.microprofile.it.faulttolerance.MicroProfileFaultToleranceRoutes.EXCEPTION_MESSAGE;
 import static org.hamcrest.Matchers.is;
 
+@Disabled("https://github.com/apache/camel-quarkus/issues/4225")
 @QuarkusTest
 class MicroprofileFaultToleranceTest {
 
diff --git a/tooling/scripts/group-tests.groovy b/tooling/scripts/group-tests.groovy
index 02eba771f7..fd5e047a22 100644
--- a/tooling/scripts/group-tests.groovy
+++ b/tooling/scripts/group-tests.groovy
@@ -34,13 +34,17 @@ import groovy.ant.AntBuilder
 final Path sourceDir = Paths.get(properties['group-tests.source.dir'])
 final String[] concatRelPaths = properties['group-tests.concat.rel.paths'].split('[\\s,]+')
 final Path destinationModuleDir = Paths.get(properties['group-tests.dest.module.dir'])
+final String excludes = properties['group-tests.files.excludes'] ?: ""
+final List<String> fileExcludes = excludes.split('[\\s,]+') as List
 /* Property names whose values originating from distinct application.properties files can be concatenated using comma as a separator */
-final Set<String> commaConcatenatePropertyNames = ["quarkus.native.resources.includes", "quarkus.native.resources.excludes"] as Set;
+final Set<String> commaConcatenatePropertyNames = ["quarkus.native.resources.includes", "quarkus.native.resources.excludes"] as Set
 
 final Map<String, ResourceConcatenator> mergedFiles = new HashMap<>()
 concatRelPaths.each {relPath -> mergedFiles.put(relPath, new ResourceConcatenator(commaConcatenatePropertyNames)) }
 
 Files.list(sourceDir)
+    .filter(p -> !fileExcludes.contains(p.getFileName().toString()))
+    .peek(p -> System.out.println(p.getFileName().toString()))
     .filter { p -> Files.exists(p.resolve('pom.xml')) }
     .sorted()
     .forEach { p ->