You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2023/08/10 14:39:04 UTC

[camel] branch flaky created (now 409a0e31394)

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

davsclaus pushed a change to branch flaky
in repository https://gitbox.apache.org/repos/asf/camel.git


      at 409a0e31394 CAMEL-19684: Attempt to fix some flaky test

This branch includes the following new commits:

     new 670f685f16e CAMEL-19684: A little potential fix but lets enable it for CI to keep an eye again
     new 409a0e31394 CAMEL-19684: Attempt to fix some flaky test

The 2 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.



[camel] 02/02: CAMEL-19684: Attempt to fix some flaky test

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

davsclaus pushed a commit to branch flaky
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 409a0e31394fd0692adb189b7aafc6f7d3310319
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Aug 10 16:38:42 2023 +0200

    CAMEL-19684: Attempt to fix some flaky test
---
 .../apache/camel/component/file/FileRecursiveNoopTest.java    | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/core/camel-core/src/test/java/org/apache/camel/component/file/FileRecursiveNoopTest.java b/core/camel-core/src/test/java/org/apache/camel/component/file/FileRecursiveNoopTest.java
index e93f05c7b2d..8e5a109ac12 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/file/FileRecursiveNoopTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/file/FileRecursiveNoopTest.java
@@ -24,12 +24,13 @@ import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 
 public class FileRecursiveNoopTest extends ContextTestSupport {
-    private final String fileUri = fileUri();
 
     @BeforeEach
     void sendMessages() {
-        template.sendBodyAndHeader(fileUri, "a", Exchange.FILE_NAME, "a.txt");
-        template.sendBodyAndHeader(fileUri, "b", Exchange.FILE_NAME, "b.txt");
+        testDirectory(true);
+
+        template.sendBodyAndHeader(fileUri(), "a", Exchange.FILE_NAME, "a.txt");
+        template.sendBodyAndHeader(fileUri(), "b", Exchange.FILE_NAME, "b.txt");
         template.sendBodyAndHeader(fileUri("foo"), "a2", Exchange.FILE_NAME, "a.txt");
         template.sendBodyAndHeader(fileUri("bar"), "c", Exchange.FILE_NAME, "c.txt");
         template.sendBodyAndHeader(fileUri("bar"), "b2", Exchange.FILE_NAME, "b.txt");
@@ -37,6 +38,8 @@ public class FileRecursiveNoopTest extends ContextTestSupport {
 
     @Test
     public void testRecursiveNoop() throws Exception {
+        context.getRouteController().startAllRoutes();
+
         MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedBodiesReceivedInAnyOrder("a", "b", "a2", "c", "b2");
 
@@ -56,7 +59,7 @@ public class FileRecursiveNoopTest extends ContextTestSupport {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from(fileUri("?initialDelay=0&delay=10&recursive=true&noop=true")).convertBodyTo(String.class)
+                from(fileUri("?initialDelay=0&delay=10&recursive=true&noop=true")).convertBodyTo(String.class).noAutoStartup()
                         .to("mock:result");
             }
         };


[camel] 01/02: CAMEL-19684: A little potential fix but lets enable it for CI to keep an eye again

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

davsclaus pushed a commit to branch flaky
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 670f685f16e831349ad68eb310f0dd16ed21fec5
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Aug 10 16:31:45 2023 +0200

    CAMEL-19684: A little potential fix but lets enable it for CI to keep an eye again
---
 .../camel/management/ManagedPooledExchangeTest.java      | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/core/camel-management/src/test/java/org/apache/camel/management/ManagedPooledExchangeTest.java b/core/camel-management/src/test/java/org/apache/camel/management/ManagedPooledExchangeTest.java
index 89453a793b8..c9044595bc1 100644
--- a/core/camel-management/src/test/java/org/apache/camel/management/ManagedPooledExchangeTest.java
+++ b/core/camel-management/src/test/java/org/apache/camel/management/ManagedPooledExchangeTest.java
@@ -30,7 +30,6 @@ import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.impl.engine.PooledExchangeFactory;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
 import org.junit.jupiter.api.condition.DisabledOnOs;
 import org.junit.jupiter.api.condition.OS;
 
@@ -39,7 +38,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertSame;
 
 @DisabledOnOs(OS.AIX)
-@DisabledIfSystemProperty(named = "ci.env.name", matches = "github.com", disabledReason = "Flaky on Github CI")
 public class ManagedPooledExchangeTest extends ManagementTestSupport {
 
     private final AtomicInteger counter = new AtomicInteger();
@@ -116,12 +114,14 @@ public class ManagedPooledExchangeTest extends ManagementTestSupport {
                             @Override
                             public void process(Exchange exchange) throws Exception {
                                 // should be same exchange instance as its pooled
-                                Exchange old = ref.get();
-                                if (old == null) {
-                                    ref.set(exchange);
-                                    exchange.getMessage().setHeader("first", true);
-                                } else {
-                                    assertSame(old, exchange);
+                                synchronized (this) {
+                                    Exchange old = ref.get();
+                                    if (old == null) {
+                                        ref.set(exchange);
+                                        exchange.getMessage().setHeader("first", true);
+                                    } else {
+                                        assertSame(old, exchange);
+                                    }
                                 }
                             }
                         })