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 7c0c41157d5 Fix flaky SSE system tests (#3349)
7c0c41157d5 is described below
commit 7c0c41157d5818eeb8dd302b5c7c31fe77b5be45
Author: Colm O hEigeartaigh <[email protected]>
AuthorDate: Fri Jul 31 14:55:06 2026 +0100
Fix flaky SSE system tests (#3349)
---
.../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 b201d08d9d3..0f11a2c5856 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
@@ -99,16 +99,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);
} catch (final IOException ex) {