You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2023/12/06 09:55:27 UTC
(tomcat) branch 10.1.x updated: Fix failing test.
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new 8858ce343f Fix failing test.
8858ce343f is described below
commit 8858ce343fa2174b82f606a63959d3bc68aade3d
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 c2d00f521f..8c25542675 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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org