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

davsclaus pushed a commit to branch chore-cli-connector-pid-file-tests
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 424c2e96eb9d7e9747dd94589bf9be9d4630e5b5
Author: Claus Ibsen <[email protected]>
AuthorDate: Mon Nov 9 15:10:24 2026 +0100

    chore: camel-cli-connector - the JFR action test no longer loses its action 
file to another test's connector
    
    LocalCliConnectorSendActionTest started a connector with the file transport,
    which polls the {pid} action file shared by every test of the fork. Running 
at
    the same time as LocalCliConnectorJfrActionTest it took that test's action
    file, so the JFR test timed out on its first attempt and only passed on the
    surefire retry. The send test dispatches directly and now gets a no-op
    transport, and the JFR test is @Isolated like the other tests that use the
    {pid} files.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    Signed-off-by: Claus Ibsen <[email protected]>
---
 .../connector/LocalCliConnectorJfrActionTest.java  |  6 ++++++
 .../connector/LocalCliConnectorSendActionTest.java | 23 +++++++++++++++++++++-
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git 
a/dsl/camel-cli-connector/src/test/java/org/apache/camel/cli/connector/LocalCliConnectorJfrActionTest.java
 
b/dsl/camel-cli-connector/src/test/java/org/apache/camel/cli/connector/LocalCliConnectorJfrActionTest.java
index 74df8e0fbad2..793a67c4e2fd 100644
--- 
a/dsl/camel-cli-connector/src/test/java/org/apache/camel/cli/connector/LocalCliConnectorJfrActionTest.java
+++ 
b/dsl/camel-cli-connector/src/test/java/org/apache/camel/cli/connector/LocalCliConnectorJfrActionTest.java
@@ -33,10 +33,16 @@ import org.apache.camel.util.json.JsonObject;
 import org.apache.camel.util.json.Jsoner;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.parallel.Isolated;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.awaitility.Awaitility.await;
 
+/**
+ * Isolated: the action and output files are keyed on the pid, which all tests 
of the fork share, so another connector
+ * polling at the same time could take the action file of this test.
+ */
+@Isolated
 class LocalCliConnectorJfrActionTest extends CamelTestSupport {
 
     private LocalCliConnector connector;
diff --git 
a/dsl/camel-cli-connector/src/test/java/org/apache/camel/cli/connector/LocalCliConnectorSendActionTest.java
 
b/dsl/camel-cli-connector/src/test/java/org/apache/camel/cli/connector/LocalCliConnectorSendActionTest.java
index 3bdb264a73c8..40f8a8af5ab3 100644
--- 
a/dsl/camel-cli-connector/src/test/java/org/apache/camel/cli/connector/LocalCliConnectorSendActionTest.java
+++ 
b/dsl/camel-cli-connector/src/test/java/org/apache/camel/cli/connector/LocalCliConnectorSendActionTest.java
@@ -68,7 +68,28 @@ class LocalCliConnectorSendActionTest {
             }
         });
         context.start();
-        connector = new LocalCliConnector(new DefaultCliConnectorFactory());
+        connector = new LocalCliConnector(new DefaultCliConnectorFactory()) {
+            @Override
+            protected CliConnectorTransport createTransport(String name) {
+                // the action is dispatched directly: the file transport would 
poll the {pid} files and take the
+                // action files of other tests running at the same time
+                return new CliConnectorTransport() {
+                    @Override
+                    public void configure(
+                            CamelContext camelContext, CliActionDispatcher 
dispatcher,
+                            CliSnapshotProducer snapshots, Runnable shutdown) {
+                    }
+
+                    @Override
+                    public void start() {
+                    }
+
+                    @Override
+                    public void stop() {
+                    }
+                };
+            }
+        };
         connector.setCamelContext(context);
         connector.start();
     }

Reply via email to