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

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

commit a4aae0b1f2fe923423719977d9f995f3f0408c9c
Author: Guillaume Nodet <[email protected]>
AuthorDate: Mon Mar 23 20:58:21 2026 +0100

    Fix pom.xml property ordering and replace Thread.sleep with executor await
    
    - Move agroal-version after activemq-artemis-version for alphabetical order
    - Replace Thread.sleep(2000) with executor.awaitTermination() in
      TransactionalClientDataSourceForcedShutdownTest to avoid flaky tests
    
    Co-Authored-By: Claude Opus 4.6 <[email protected]>
---
 .../TransactionalClientDataSourceForcedShutdownTest.java       | 10 ++++++----
 parent/pom.xml                                                 |  2 +-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git 
a/components/camel-spring-parent/camel-spring-xml/src/test/java/org/apache/camel/spring/interceptor/TransactionalClientDataSourceForcedShutdownTest.java
 
b/components/camel-spring-parent/camel-spring-xml/src/test/java/org/apache/camel/spring/interceptor/TransactionalClientDataSourceForcedShutdownTest.java
index b8258f108bd0..cb4bfff2aa83 100644
--- 
a/components/camel-spring-parent/camel-spring-xml/src/test/java/org/apache/camel/spring/interceptor/TransactionalClientDataSourceForcedShutdownTest.java
+++ 
b/components/camel-spring-parent/camel-spring-xml/src/test/java/org/apache/camel/spring/interceptor/TransactionalClientDataSourceForcedShutdownTest.java
@@ -34,6 +34,7 @@ import org.apache.camel.support.service.ServiceHelper;
 import org.junit.jupiter.api.Test;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 /**
  * Test that verifies in-flight transacted exchanges are rolled back when a 
forced shutdown occurs.
@@ -70,8 +71,10 @@ public class TransactionalClientDataSourceForcedShutdownTest 
extends Transaction
             // release the blocking processor so the exchange can complete
             releaseLatch.countDown();
 
-            // give the exchange time to complete
-            Thread.sleep(2000);
+            // wait for the exchange to finish processing
+            executor.shutdown();
+            assertTrue(executor.awaitTermination(10, TimeUnit.SECONDS),
+                    "Exchange processing should have completed");
 
             // verify that the transaction was rolled back
             // before the fix: count = 3 (original + 2 inserts committed)
@@ -80,8 +83,7 @@ public class TransactionalClientDataSourceForcedShutdownTest 
extends Transaction
             assertEquals(1, count, "Number of books after forced shutdown - 
transaction should have been rolled back");
         } finally {
             releaseLatch.countDown(); // ensure we don't hang if test fails
-            executor.shutdown();
-            executor.awaitTermination(10, TimeUnit.SECONDS);
+            executor.shutdownNow();
         }
     }
 
diff --git a/parent/pom.xml b/parent/pom.xml
index 1fc83d65805f..f047723f6bd4 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -60,8 +60,8 @@
         <!-- dependency versions -->
         <activemq-version>5.19.2</activemq-version>
         <activemq6-version>6.2.1</activemq6-version>
-        <agroal-version>3.0</agroal-version>
         <activemq-artemis-version>2.44.0</activemq-artemis-version>
+        <agroal-version>3.0</agroal-version>
         <allegro-converter-version>0.3.0</allegro-converter-version>
         <amazon-kinesis-client-version>3.4.1</amazon-kinesis-client-version>
         <angus-mail-version>2.0.5</angus-mail-version>

Reply via email to