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

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


The following commit(s) were added to refs/heads/8.5.x by this push:
     new 0adacdd  Make test more robust
0adacdd is described below

commit 0adacdddb74533b86ef912a436d1c3dc5a0a92c2
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Jan 12 10:41:51 2022 +0000

    Make test more robust
    
    Failure was observed on Travis CI and could be replicated locally in a
    debugger using suitable break points.
---
 test/org/apache/coyote/http2/TestHttp2Section_3_5.java | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/test/org/apache/coyote/http2/TestHttp2Section_3_5.java 
b/test/org/apache/coyote/http2/TestHttp2Section_3_5.java
index e9a9e0e..2e45e3a 100644
--- a/test/org/apache/coyote/http2/TestHttp2Section_3_5.java
+++ b/test/org/apache/coyote/http2/TestHttp2Section_3_5.java
@@ -41,7 +41,17 @@ public class TestHttp2Section_3_5 extends Http2TestBase {
         // Send two pings (2*(9+8)=34 bytes) as server looks for entire preface
         // of 24 bytes.
         sendPing();
-        sendPing();
+        // Depending on timing, this ping may fail after the header has been
+        // sent but before the ping body since:
+        // 9 (ping 1 header) + 8 (ping 1 body) + 9 (ping 2 header) = 26 which
+        // which is enough data for the server to determine that the preface is
+        // invalid and close the connection. A subsequent attempt to send ping 
2
+        // body will fail.
+        try {
+            sendPing();
+        } catch (IOException e) {
+            // Ignore
+        }
 
         // If the client preface had been valid, this would be an
         // acknowledgement. Of the settings. As the preface was invalid, it

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to