Skip to content

Commit 123aa50

Browse files
committed
4.x Intermittent pipeline test failure in SseClientTest.testSseJson1 #10471
Signed-off-by: Jorge Bescos Gascon <[email protected]>
1 parent 8e6851f commit 123aa50

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

webserver/tests/sse/src/test/java/io/helidon/webserver/tests/sse/SseBaseTest.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023, 2024 Oracle and/or its affiliates.
2+
* Copyright (c) 2023, 2025 Oracle and/or its affiliates.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -31,6 +31,7 @@
3131

3232
class SseBaseTest {
3333

34+
private static final System.Logger LOGGER = System.getLogger(SseBaseTest.class.getName());
3435
private final WebServer webServer;
3536

3637
SseBaseTest() {
@@ -62,11 +63,14 @@ static void sseString2(ServerRequest req, ServerResponse res) throws Interrupted
6263
}
6364

6465
static void sseJson1(ServerRequest req, ServerResponse res) {
66+
LOGGER.log(System.Logger.Level.ERROR, "sseJson1 called");
6567
JsonObject json = Json.createObjectBuilder()
6668
.add("hello", "world")
6769
.build();
6870
try (SseSink sseSink = res.sink(SseSink.TYPE)) {
71+
LOGGER.log(System.Logger.Level.ERROR, "sseJson1 sseSink called");
6972
sseSink.emit(SseEvent.create(json));
73+
LOGGER.log(System.Logger.Level.ERROR, "sseJson1 emit called");
7074
}
7175
}
7276

@@ -84,10 +88,13 @@ public void setHello(String hello) {
8488
}
8589

8690
static void sseJson2(ServerRequest req, ServerResponse res) {
91+
LOGGER.log(System.Logger.Level.ERROR, "sseJson2 called");
8792
SseServerTest.HelloWorld json = new SseServerTest.HelloWorld();
8893
json.setHello("world");
8994
try (SseSink sseSink = res.sink(SseSink.TYPE)) {
95+
LOGGER.log(System.Logger.Level.ERROR, "sseJson2 sseSink called");
9096
sseSink.emit(SseEvent.create(json));
97+
LOGGER.log(System.Logger.Level.ERROR, "sseJson2 emit called");
9198
}
9299
}
93100

webserver/tests/sse/src/test/java/io/helidon/webserver/tests/sse/SseClientTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
@Disabled
4646
class SseClientTest extends SseBaseTest {
4747

48+
private static final System.Logger LOGGER = System.getLogger(SseClientTest.class.getName());
4849
private final Http1Client client;
4950

5051
SseClientTest(WebServer webServer, Http1Client client) {
@@ -145,9 +146,12 @@ public void onClose() {
145146

146147
@Test
147148
void testSseJson1() throws InterruptedException {
149+
LOGGER.log(System.Logger.Level.ERROR, "testSseJson1 called");
148150
try (Http1ClientResponse r = client.get("/sseJson1").header(ACCEPT_EVENT_STREAM).request()) {
151+
LOGGER.log(System.Logger.Level.ERROR, "testSseJson1 client called");
149152
CountDownLatch latch = new CountDownLatch(1);
150153
r.source(SseSource.TYPE, event -> {
154+
LOGGER.log(System.Logger.Level.ERROR, "testSseJson1 source called");
151155
JsonObject json = event.data(JsonObject.class);
152156
assertThat(json, is(notNullValue()));
153157
assertThat(json.getString("hello"), is("world"));
@@ -159,9 +163,12 @@ void testSseJson1() throws InterruptedException {
159163

160164
@Test
161165
void testSseJson2() throws InterruptedException {
166+
LOGGER.log(System.Logger.Level.ERROR, "testSseJson2 called");
162167
try (Http1ClientResponse r = client.get("/sseJson2").header(ACCEPT_EVENT_STREAM).request()) {
168+
LOGGER.log(System.Logger.Level.ERROR, "testSseJson2 client called");
163169
CountDownLatch latch = new CountDownLatch(1);
164170
r.source(SseSource.TYPE, event -> {
171+
LOGGER.log(System.Logger.Level.ERROR, "testSseJson2 source called");
165172
HelloWorld json = event.data(HelloWorld.class, MediaTypes.APPLICATION_JSON);
166173
assertThat(json, is(notNullValue()));
167174
assertThat(json.getHello(), is("world"));

0 commit comments

Comments
 (0)