This is an automated email from the ASF dual-hosted git repository.
coheigea pushed a commit to branch 3.6.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git
The following commit(s) were added to refs/heads/3.6.x-fixes by this push:
new 36fb9d6b145 Fix flaky SSE system tests (#3349)
36fb9d6b145 is described below
commit 36fb9d6b1454f64f64fae040afcdfedc81fad034
Author: Colm O hEigeartaigh <[email protected]>
AuthorDate: Fri Jul 31 14:55:06 2026 +0100
Fix flaky SSE system tests (#3349)
(cherry picked from commit 7c0c41157d5818eeb8dd302b5c7c31fe77b5be45)
---
.../cxf/systest/jaxrs/sse/BookStoreClientCloseable.java | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git
a/systests/rs-sse/rs-sse-base/src/main/java/org/apache/cxf/systest/jaxrs/sse/BookStoreClientCloseable.java
b/systests/rs-sse/rs-sse-base/src/main/java/org/apache/cxf/systest/jaxrs/sse/BookStoreClientCloseable.java
index 2fb50a69781..a8a59b73cbf 100644
---
a/systests/rs-sse/rs-sse-base/src/main/java/org/apache/cxf/systest/jaxrs/sse/BookStoreClientCloseable.java
+++
b/systests/rs-sse/rs-sse-base/src/main/java/org/apache/cxf/systest/jaxrs/sse/BookStoreClientCloseable.java
@@ -98,16 +98,18 @@ abstract class BookStoreClientCloseable {
Thread.sleep(500);
localBroadcaster.broadcast(createEvent(builder.name("book"),
id + 4))
.whenComplete((r, ex) -> {
- // we expect the sink to be closed at this point
- if (ex != null || !sink.isClosed()) {
+ // Count only an unexpected successful delivery after
client close.
+ if (ex == null && !sink.isClosed()) {
stats.inc();
}
});
- stats.setWasClosed(sink.isClosed());
- phaser.arriveAndDeregister();
-
- sink.close();
+ try {
+ sink.close();
+ } finally {
+ stats.setWasClosed(sink.isClosed());
+ phaser.arriveAndDeregister();
+ }
} catch (final InterruptedException ex) {
LOG.error("Communication error", ex);
}