From 8c3ceaabaa2f8a8edd41f60603c53cb544295f11 Mon Sep 17 00:00:00 2001 From: Guillaume Nodet Date: Thu, 12 Mar 2026 18:25:38 +0100 Subject: [PATCH] Fix flaky Grizzly EndpointAPITest: use graceful server shutdown Replace shutdownNow() with graceful shutdown().get() with timeout to ensure the server fully releases ports and resources before the next test starts. Co-Authored-By: Claude Opus 4.6 --- .../org/apache/cxf/systest/grizzly/EndpointAPITest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/systests/container-integration/grizzly/src/test/java/org/apache/cxf/systest/grizzly/EndpointAPITest.java b/systests/container-integration/grizzly/src/test/java/org/apache/cxf/systest/grizzly/EndpointAPITest.java index d05473c8bf5..2750e30bcaf 100644 --- a/systests/container-integration/grizzly/src/test/java/org/apache/cxf/systest/grizzly/EndpointAPITest.java +++ b/systests/container-integration/grizzly/src/test/java/org/apache/cxf/systest/grizzly/EndpointAPITest.java @@ -23,6 +23,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.net.URL; +import java.util.concurrent.TimeUnit; import javax.xml.namespace.QName; @@ -62,7 +63,11 @@ public void setUp() { @After public void tearDown() { - server.shutdownNow(); + try { + server.shutdown().get(10, TimeUnit.SECONDS); + } catch (Exception e) { + server.shutdownNow(); + } server = null; }