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 97ca59504d Fix failing test. 97ca59504d is described below commit 97ca59504dc6747fbfbc7619c55069a9441308fa Author: Mark Thomas <ma...@apache.org> AuthorDate: Wed Dec 6 08:55:03 2023 +0000 Fix failing test. NIO2 + Windows behaves slightly differently to NIO2 + Linux. --- test/org/apache/catalina/connector/TestClientReadTimeout.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/org/apache/catalina/connector/TestClientReadTimeout.java b/test/org/apache/catalina/connector/TestClientReadTimeout.java index 66a3334487..9342249ab0 100644 --- a/test/org/apache/catalina/connector/TestClientReadTimeout.java +++ b/test/org/apache/catalina/connector/TestClientReadTimeout.java @@ -22,6 +22,7 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.net.Socket; +import java.net.SocketException; import java.nio.charset.StandardCharsets; import javax.servlet.ServletException; @@ -65,7 +66,12 @@ public class TestClientReadTimeout extends TomcatBaseTest { os.write(request.getBytes(StandardCharsets.UTF_8)); InputStream is = socket.getInputStream(); BufferedReader reader = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8)); - String opening = reader.readLine(); + String opening = null; + try { + opening = reader.readLine(); + } catch (SocketException e) { + // Handled below. An exception here means opening will be null + } if (tomcat.getConnector().getProtocolHandlerClassName().contains("Nio2")) { Assert.assertNull("NIO2 unexpectedly returned a response", opening); } else { --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org