This is an automated email from the ASF dual-hosted git repository.
markt 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 440d02f224 Fix failing test.
440d02f224 is described below
commit 440d02f22469e28398a51a2237dbe237aa7a64f8
Author: Mark Thomas <[email protected]>
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 c2d00f521f..65d4cef92b 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 jakarta.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: [email protected]
For additional commands, e-mail: [email protected]