This is an automated email from the ASF dual-hosted git repository.
coheigea pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cxf.git
The following commit(s) were added to refs/heads/main by this push:
new 5ec112363bf Fix ExecutorService leak in WS-RM oneway tests (#2963)
5ec112363bf is described below
commit 5ec112363bf117c842c8d4d54b6cd59c231dc704
Author: Guillaume Nodet <[email protected]>
AuthorDate: Fri Jul 24 11:34:38 2026 +0200
Fix ExecutorService leak in WS-RM oneway tests (#2963)
DeliveryAssuranceOnewayTest and MessageCallbackOnewayTest create
ExecutorService instances via Executors.newSingleThreadExecutor() but
never shut them down. The leaked non-daemon threads prevent clean test
completion, causing intermittent timeouts in CI (~95-100s for
DeliveryAssurance, ~75s for MessageCallback).
Track the ExecutorService and shut it down in tearDown() with a
10-second grace period before forceful termination.
Co-authored-by: Claude Opus 4.6 <[email protected]>
---
.../cxf/systest/ws/rm/DeliveryAssuranceOnewayTest.java | 11 +++++++++++
.../apache/cxf/systest/ws/rm/MessageCallbackOnewayTest.java | 12 ++++++++++++
2 files changed, 23 insertions(+)
diff --git
a/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/DeliveryAssuranceOnewayTest.java
b/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/DeliveryAssuranceOnewayTest.java
index 0477cdb7a83..054094adb64 100644
---
a/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/DeliveryAssuranceOnewayTest.java
+++
b/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/DeliveryAssuranceOnewayTest.java
@@ -76,6 +76,7 @@ public class DeliveryAssuranceOnewayTest extends
AbstractBusClientServerTestBase
private Endpoint endpoint;
private Bus greeterBus;
private Greeter greeter;
+ private ExecutorService executorService;
@After
public void tearDown() throws Exception {
@@ -89,6 +90,13 @@ public class DeliveryAssuranceOnewayTest extends
AbstractBusClientServerTestBase
} catch (Throwable t) {
//ignore
}
+ if (executorService != null) {
+ executorService.shutdown();
+ if (!executorService.awaitTermination(10, TimeUnit.SECONDS)) {
+ executorService.shutdownNow();
+ }
+ executorService = null;
+ }
Thread.sleep(100);
}
@@ -380,6 +388,9 @@ public class DeliveryAssuranceOnewayTest extends
AbstractBusClientServerTestBase
if (null != executor) {
gs.setExecutor(executor);
+ if (executor instanceof ExecutorService) {
+ this.executorService = (ExecutorService) executor;
+ }
}
greeter = gs.getGreeterPort();
diff --git
a/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/MessageCallbackOnewayTest.java
b/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/MessageCallbackOnewayTest.java
index 6d73c098c13..6f30dfc6f6a 100644
---
a/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/MessageCallbackOnewayTest.java
+++
b/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/MessageCallbackOnewayTest.java
@@ -25,6 +25,7 @@ import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.Executor;
+import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
@@ -81,6 +82,7 @@ public class MessageCallbackOnewayTest extends
AbstractBusClientServerTestBase {
private Bus greeterBus;
private Greeter greeter;
private RecordingMessageCallback callback;
+ private ExecutorService executorService;
@After
public void tearDown() throws Exception {
@@ -94,6 +96,13 @@ public class MessageCallbackOnewayTest extends
AbstractBusClientServerTestBase {
} catch (Throwable t) {
//ignore
}
+ if (executorService != null) {
+ executorService.shutdown();
+ if (!executorService.awaitTermination(10, TimeUnit.SECONDS)) {
+ executorService.shutdownNow();
+ }
+ executorService = null;
+ }
}
@Test(timeout = 60000)
@@ -216,6 +225,9 @@ public class MessageCallbackOnewayTest extends
AbstractBusClientServerTestBase {
if (null != executor) {
gs.setExecutor(executor);
+ if (executor instanceof ExecutorService) {
+ this.executorService = (ExecutorService) executor;
+ }
}
greeter = gs.getGreeterPort();