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

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

commit b3d6d4862f4c7bfd75b221406af114ec2e3ba0a5
Author: James Netherton <[email protected]>
AuthorDate: Thu Jan 27 10:59:21 2022 +0000

    camel.main.durationMaxSeconds is not honoured
    
    Fixes #3394
---
 .../src/main/java/org/apache/camel/quarkus/main/CamelMain.java        | 1 +
 .../java/org/apache/camel/quarkus/main/cmd/it/CommandModeTest.java    | 4 +---
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git 
a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java
 
b/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java
index 579e668..a97c38b 100644
--- 
a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java
+++ 
b/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java
@@ -135,6 +135,7 @@ public final class CamelMain extends MainCommandLineSupport 
implements HasCamelC
     public void startEngine() throws Exception {
         if (shutdownStrategy.isRunAllowed() && 
engineStarted.compareAndSet(false, true)) {
             init();
+            internalBeforeStart();
             beforeStart();
             start();
             afterStart();
diff --git 
a/integration-tests/main-command-mode/src/test/java/org/apache/camel/quarkus/main/cmd/it/CommandModeTest.java
 
b/integration-tests/main-command-mode/src/test/java/org/apache/camel/quarkus/main/cmd/it/CommandModeTest.java
index ff128aa..f723e4c 100644
--- 
a/integration-tests/main-command-mode/src/test/java/org/apache/camel/quarkus/main/cmd/it/CommandModeTest.java
+++ 
b/integration-tests/main-command-mode/src/test/java/org/apache/camel/quarkus/main/cmd/it/CommandModeTest.java
@@ -24,7 +24,6 @@ import java.util.concurrent.TimeoutException;
 import org.apache.camel.quarkus.test.support.process.QuarkusProcessExecutor;
 import org.apache.camel.util.StringHelper;
 import org.assertj.core.api.Assertions;
-import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 import org.zeroturnaround.exec.InvalidExitValueException;
 import org.zeroturnaround.exec.ProcessResult;
@@ -76,13 +75,12 @@ public class CommandModeTest {
         assertThat(result.outputUTF8()).contains("Apache Camel Runner takes 
the following options");
     }
 
-    @Disabled("https://github.com/apache/camel-quarkus/issues/3394";)
     @Test
     void testMainStopsAfterMaxSeconds() throws IOException, 
InterruptedException, ExecutionException {
         final StartedProcess process = new 
QuarkusProcessExecutor("-Dgreeted.subject=Jade",
                 "-Dcamel.main.duration-max-seconds=3").start();
         try {
-            ProcessResult result = process.getFuture().get(4, 
TimeUnit.SECONDS);
+            ProcessResult result = process.getFuture().get(10, 
TimeUnit.SECONDS);
             Assertions.assertThat(result.getExitValue()).isEqualTo(0);
             Assertions.assertThat(result.outputUTF8()).contains("Waiting until 
complete: Duration max 3 seconds");
             Assertions.assertThat(result.outputUTF8()).contains("Logging Hello 
Jade! - from timer named hello");

Reply via email to