You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by re...@apache.org on 2022/07/06 00:24:37 UTC

[cxf] branch 3.6.x-fixes updated (6db3943624 -> 980ebec9b4)

This is an automated email from the ASF dual-hosted git repository.

reta pushed a change to branch 3.6.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git


    omit 6db3943624 Fixing Undertow SSE test failures caused by [UNDERTOW-1786] (handle IO properly for async context write)
     new 980ebec9b4 Fixing Undertow SSE test failures caused by [UNDERTOW-1786] (handle IO properly for async context write)

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (6db3943624)
            \
             N -- N -- N   refs/heads/3.6.x-fixes (980ebec9b4)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 systests/rs-sse/rs-sse-base/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


[cxf] 01/01: Fixing Undertow SSE test failures caused by [UNDERTOW-1786] (handle IO properly for async context write)

Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

reta pushed a commit to branch 3.6.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 980ebec9b4e3cb99c0386ba3c795cad21e924ac7
Author: Andriy Redko <dr...@gmail.com>
AuthorDate: Tue Jul 5 19:55:48 2022 -0400

    Fixing Undertow SSE test failures caused by [UNDERTOW-1786] (handle IO properly for async context write)
---
 systests/rs-sse/rs-sse-base/pom.xml                |  5 +++
 .../cxf/systest/jaxrs/sse/AbstractSseTest.java     | 41 ++++++++++++----------
 .../jaxrs/sse/undertow/UndertowEmbeddedTest.java   |  5 +++
 3 files changed, 32 insertions(+), 19 deletions(-)

diff --git a/systests/rs-sse/rs-sse-base/pom.xml b/systests/rs-sse/rs-sse-base/pom.xml
index 56a6680b7c..1b531aea9c 100644
--- a/systests/rs-sse/rs-sse-base/pom.xml
+++ b/systests/rs-sse/rs-sse-base/pom.xml
@@ -70,5 +70,10 @@
             <groupId>jakarta.xml.ws</groupId>
             <artifactId>jakarta.xml.ws-api</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.awaitility</groupId>
+            <artifactId>awaitility</artifactId>
+            <scope>compile</scope>
+        </dependency>
     </dependencies>
 </project>
diff --git a/systests/rs-sse/rs-sse-base/src/main/java/org/apache/cxf/systest/jaxrs/sse/AbstractSseTest.java b/systests/rs-sse/rs-sse-base/src/main/java/org/apache/cxf/systest/jaxrs/sse/AbstractSseTest.java
index e02a001575..7005d98533 100644
--- a/systests/rs-sse/rs-sse-base/src/main/java/org/apache/cxf/systest/jaxrs/sse/AbstractSseTest.java
+++ b/systests/rs-sse/rs-sse-base/src/main/java/org/apache/cxf/systest/jaxrs/sse/AbstractSseTest.java
@@ -49,6 +49,7 @@ import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.awaitility.Awaitility.await;
 import static org.hamcrest.CoreMatchers.containsString;
 import static org.hamcrest.CoreMatchers.equalTo;
 import static org.hamcrest.CoreMatchers.hasItems;
@@ -375,25 +376,27 @@ public abstract class AbstractSseTest extends AbstractSseBaseTest {
                 .put(null);
         assertThat(r.getStatus(), equalTo(204));
 
-        // Give server some time to finish up the sink
-        Thread.sleep(2000);
-
-        // Only two out of 4 messages should be delivered, others should be discarded
-        final BookBroadcasterStats stats =
-            createWebClient("/rest/api/bookstore/client-closes-connection/stats", MediaType.APPLICATION_JSON)
-                .get()
-                .readEntity(BookBroadcasterStats.class);
-
-        // Tomcat will feedback through onError callback, others through onComplete
-        assertThat(stats.isErrored(), equalTo(supportsErrorPropagation()));
-        // The sink should be in closed state
-        assertThat(stats.isWasClosed(), equalTo(true));
-        // The onClose callback should be called
-        assertThat(stats.isClosed(), equalTo(true));
-
-        // It is very hard to get the predictable match here, but at most
-        // 2 events could get through before the client's connection drop off
-        assertTrue(stats.getCompleted() == 2 || stats.getCompleted() == 1);
+        await()
+            .atMost(10, TimeUnit.SECONDS)
+            .pollDelay(1, TimeUnit.SECONDS)
+            .untilAsserted(() -> {
+                // Only two out of 4 messages should be delivered, others should be discarded
+                final BookBroadcasterStats stats =
+                    createWebClient("/rest/api/bookstore/client-closes-connection/stats", MediaType.APPLICATION_JSON)
+                        .get()
+                        .readEntity(BookBroadcasterStats.class);
+
+                // Tomcat will feedback through onError callback, others through onComplete
+                assertThat(stats.isErrored(), equalTo(supportsErrorPropagation()));
+                // The sink should be in closed state
+                assertThat(stats.isWasClosed(), equalTo(true));
+                // The onClose callback should be called
+                assertThat(stats.isClosed(), equalTo(true));
+
+                // It is very hard to get the predictable match here, but at most
+                // 2 events could get through before the client's connection drop off
+                assertTrue(stats.getCompleted() <= 3);
+            });
     }
 
     @Test
diff --git a/systests/rs-sse/rs-sse-undertow/src/test/java/org/apache/cxf/systest/jaxrs/sse/undertow/UndertowEmbeddedTest.java b/systests/rs-sse/rs-sse-undertow/src/test/java/org/apache/cxf/systest/jaxrs/sse/undertow/UndertowEmbeddedTest.java
index 0c48ce1551..6f6c80fe5b 100644
--- a/systests/rs-sse/rs-sse-undertow/src/test/java/org/apache/cxf/systest/jaxrs/sse/undertow/UndertowEmbeddedTest.java
+++ b/systests/rs-sse/rs-sse-undertow/src/test/java/org/apache/cxf/systest/jaxrs/sse/undertow/UndertowEmbeddedTest.java
@@ -48,5 +48,10 @@ public class UndertowEmbeddedTest extends AbstractSseTest {
     protected int getPort() {
         return EmbeddedTomcatServer.PORT;
     }
+    
+    @Override
+    protected boolean supportsErrorPropagation() {
+        return true;
+    }
 
 }