This is an automated email from the ASF dual-hosted git repository. jamesnetherton pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/master by this push: new db86e1a Fix intermittent failure in camel-quarkus-master-integration-test db86e1a is described below commit db86e1abc039957a7e529d7fb028a8a8a8a9bb91 Author: James Netherton <jamesnether...@gmail.com> AuthorDate: Tue Mar 30 15:16:09 2021 +0100 Fix intermittent failure in camel-quarkus-master-integration-test --- .../apache/camel/quarkus/component/master/it/MasterResource.java | 8 ++++---- .../apache/camel/quarkus/component/master/it/MasterRoutes.java | 2 +- .../org/apache/camel/quarkus/component/master/it/MasterIT.java | 3 --- .../org/apache/camel/quarkus/component/master/it/MasterTest.java | 2 +- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/integration-tests/master/src/main/java/org/apache/camel/quarkus/component/master/it/MasterResource.java b/integration-tests/master/src/main/java/org/apache/camel/quarkus/component/master/it/MasterResource.java index eb3a44b..c9eb6c9 100644 --- a/integration-tests/master/src/main/java/org/apache/camel/quarkus/component/master/it/MasterResource.java +++ b/integration-tests/master/src/main/java/org/apache/camel/quarkus/component/master/it/MasterResource.java @@ -26,11 +26,11 @@ import org.apache.camel.CamelContext; public class MasterResource { @Inject - private CamelContext camelContext; + CamelContext camelContext; - @Path("/camel/stop") + @Path("/camel/stop/leader") @GET - public void stopCamelContext() { - camelContext.stop(); + public void stopLeaderRoute() throws Exception { + camelContext.getRouteController().stopRoute("leader"); } } diff --git a/integration-tests/master/src/main/java/org/apache/camel/quarkus/component/master/it/MasterRoutes.java b/integration-tests/master/src/main/java/org/apache/camel/quarkus/component/master/it/MasterRoutes.java index 4bb7140..226e1f8 100644 --- a/integration-tests/master/src/main/java/org/apache/camel/quarkus/component/master/it/MasterRoutes.java +++ b/integration-tests/master/src/main/java/org/apache/camel/quarkus/component/master/it/MasterRoutes.java @@ -40,7 +40,7 @@ public class MasterRoutes extends RouteBuilder { getContext().addService(service); // Output the id of the application into a file - from("master:ns:timer:test?period=100") + from("master:ns:timer:test?period=100").id("leader") .setBody(constant(applicationId)) .setHeader(Exchange.FILE_NAME, constant("leader.txt")) .to("file:target/cluster/"); diff --git a/integration-tests/master/src/test/java/org/apache/camel/quarkus/component/master/it/MasterIT.java b/integration-tests/master/src/test/java/org/apache/camel/quarkus/component/master/it/MasterIT.java index b8b38aa..e734a28 100644 --- a/integration-tests/master/src/test/java/org/apache/camel/quarkus/component/master/it/MasterIT.java +++ b/integration-tests/master/src/test/java/org/apache/camel/quarkus/component/master/it/MasterIT.java @@ -17,11 +17,8 @@ package org.apache.camel.quarkus.component.master.it; import io.quarkus.test.junit.NativeImageTest; -import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; @NativeImageTest -// https://github.com/apache/camel-quarkus/issues/2384 -@DisabledIfEnvironmentVariable(named = "CI", matches = "true") class MasterIT extends MasterTest { } diff --git a/integration-tests/master/src/test/java/org/apache/camel/quarkus/component/master/it/MasterTest.java b/integration-tests/master/src/test/java/org/apache/camel/quarkus/component/master/it/MasterTest.java index c1c10de..fc93102 100644 --- a/integration-tests/master/src/test/java/org/apache/camel/quarkus/component/master/it/MasterTest.java +++ b/integration-tests/master/src/test/java/org/apache/camel/quarkus/component/master/it/MasterTest.java @@ -50,7 +50,7 @@ class MasterTest { // Stop camel to trigger failover RestAssured.given() - .get("/master/camel/stop") + .get("/master/camel/stop/leader") .then() .statusCode(204);