This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 47459c6eeb38 CAMEL-26468: camel-cxf-soap - fail a hanging
CxfProducerTest after 30 seconds with a thread dump (#28800)
47459c6eeb38 is described below
commit 47459c6eeb388615c763fefeec94b101ac62cad4
Author: Claus Ibsen <[email protected]>
AuthorDate: Mon Nov 2 07:32:03 2026 +0100
CAMEL-26468: camel-cxf-soap - fail a hanging CxfProducerTest after 30
seconds with a thread dump (#28800)
… seconds with a thread dump
The CxfProducerTest family (CxfProducerTest, CxfProducerContextTest,
CxfProducerOperationTest) sometimes hangs on CI. The module allows a fork
300 seconds (camel.surefire.forkTimeout), so surefire kills the whole fork
and the build fails without saying where the test was stuck.
Give the tests and the lifecycle methods of CxfProducerTest a 30 second
timeout in a separate thread, and turn on JUnit's thread dump on timeout
for the module. A hang now fails only that test, which surefire retries,
and the log shows the stack of every thread so the cause can be fixed.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Claus Ibsen <[email protected]>
---
.../camel/component/cxf/jaxws/CxfProducerTest.java | 9 +++++++++
.../src/test/resources/junit-platform.properties | 19 +++++++++++++++++++
2 files changed, 28 insertions(+)
diff --git
a/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/jaxws/CxfProducerTest.java
b/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/jaxws/CxfProducerTest.java
index 3e50e7af58e0..43a7653cb751 100644
---
a/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/jaxws/CxfProducerTest.java
+++
b/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/jaxws/CxfProducerTest.java
@@ -44,6 +44,8 @@ import org.apache.hello_world_soap_http.GreeterImpl;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
+import org.junit.jupiter.api.Timeout.ThreadMode;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -53,6 +55,9 @@ import static
org.junit.jupiter.api.Assertions.assertInstanceOf;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
+// CAMEL-26468: these tests sometimes hang on CI, which used to kill the whole
fork (camel.surefire.forkTimeout).
+// The timeout fails only the stuck test, and junit-platform.properties prints
a thread dump to show where it hangs.
+@Timeout(value = 30, threadMode = ThreadMode.SEPARATE_THREAD)
public class CxfProducerTest {
@RegisterExtension
final AvailablePortFinder.Port simplePort = AvailablePortFinder.find();
@@ -88,6 +93,7 @@ public class CxfProducerTest {
}
@BeforeEach
+ @Timeout(value = 30, threadMode = ThreadMode.SEPARATE_THREAD)
public void startService() throws Exception {
// start a simple front service
ServerFactoryBean svrBean = new ServerFactoryBean();
@@ -102,6 +108,7 @@ public class CxfProducerTest {
}
@AfterEach
+ @Timeout(value = 30, threadMode = ThreadMode.SEPARATE_THREAD)
public void stopServices() throws Exception {
endpoint.stop();
server.stop();
@@ -109,6 +116,7 @@ public class CxfProducerTest {
}
@BeforeEach
+ @Timeout(value = 30, threadMode = ThreadMode.SEPARATE_THREAD)
public void setUp() throws Exception {
camelContext = new DefaultCamelContext();
camelContext.start();
@@ -116,6 +124,7 @@ public class CxfProducerTest {
}
@AfterEach
+ @Timeout(value = 30, threadMode = ThreadMode.SEPARATE_THREAD)
public void tearDown() throws Exception {
template.stop();
camelContext.stop();
diff --git
a/components/camel-cxf/camel-cxf-soap/src/test/resources/junit-platform.properties
b/components/camel-cxf/camel-cxf-soap/src/test/resources/junit-platform.properties
new file mode 100644
index 000000000000..a1efdc6fcb41
--- /dev/null
+++
b/components/camel-cxf/camel-cxf-soap/src/test/resources/junit-platform.properties
@@ -0,0 +1,19 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+# CAMEL-26468: print a thread dump when a test hits its @Timeout, to show
where it hangs
+junit.jupiter.execution.timeout.threaddump.enabled = true