(tomcat) branch main updated: Fix test failure observed on MacOS (but could happen on any OS)

[email protected]
Newsgroups gmane.comp.jakarta.tomcat.devel
Message-ID <178651943050.674899.14529967993608836288@gitbox3-he-fi.apache.org>
This is an automated email from the ASF dual-hosted git repository.

markt-asf pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new 16e57c5ccd Fix test failure observed on MacOS (but could happen on any OS)
16e57c5ccd is described below

commit 16e57c5ccd21df0fd81aca420cd0c0b839fb5f58
Author: Mark Thomas <[email protected]>
AuthorDate: Wed Aug 12 08:23:12 2026 +0100

    Fix test failure observed on MacOS (but could happen on any OS)
---
 test/org/apache/coyote/http2/TestHttp2Section_5_2.java | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/test/org/apache/coyote/http2/TestHttp2Section_5_2.java b/test/org/apache/coyote/http2/TestHttp2Section_5_2.java
index 6c26c7728f..c42d35abcb 100644
--- a/test/org/apache/coyote/http2/TestHttp2Section_5_2.java
+++ b/test/org/apache/coyote/http2/TestHttp2Section_5_2.java
@@ -134,15 +134,23 @@ public class TestHttp2Section_5_2 extends Http2TestBase {
             parser.readFrame();
         }
 
+        output.clearTrace();
+
         // Connection flow control window is now empty
 
         // Put a stream on the backlog and then immediately cancel it
         sendSimpleGetRequest(17);
         sendRst(17, Http2Error.NO_ERROR.getCode());
-        // Read headers
-        parser.readFrame();
-        // Read reset from server
+        /*
+         * There is a server side race here. The start of the response may or may not be received before the RST is
+         * processed. Handle both cases. Once the RST is received, no further frames will be received for that stream.
+         */
+        // Read headers or RST
         parser.readFrame();
+        if (output.getTrace().startsWith("17-HeadersStart")) {
+            // Read reset from server
+            parser.readFrame();
+        }
 
         // Increase default window size to 8k
         sendSettings(0, false, new SettingValue(4, 8 * 1024));
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.