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

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

commit 70fa3d3cf524a069299cf3070a27c496d3e836f3
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Jan 12 15:14:27 2022 +0000

    Fix tests failing on Windows Server 2022
---
 test/org/apache/coyote/http11/upgrade/TestUpgrade.java | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/test/org/apache/coyote/http11/upgrade/TestUpgrade.java 
b/test/org/apache/coyote/http11/upgrade/TestUpgrade.java
index 2d99506..b9b1719 100644
--- a/test/org/apache/coyote/http11/upgrade/TestUpgrade.java
+++ b/test/org/apache/coyote/http11/upgrade/TestUpgrade.java
@@ -26,6 +26,7 @@ import java.io.PrintWriter;
 import java.io.Reader;
 import java.io.Writer;
 import java.net.Socket;
+import java.net.SocketException;
 import java.nio.charset.StandardCharsets;
 
 import javax.net.SocketFactory;
@@ -107,7 +108,13 @@ public class TestUpgrade extends TomcatBaseTest {
         UpgradeConnection conn = doUpgrade(upgradeHandlerClass);
 
         Reader r = conn.getReader();
-        int c = r.read();
+        int c;
+        try {
+            c = r.read();
+        } catch (SocketException se) {
+            // Some platforms will throw an exception rather than returning -1
+            c = -1;
+        }
 
         Assert.assertEquals(-1, c);
     }

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

Reply via email to