[tomcat] branch master updated: Fix test observed to fail consistently with NIO2 + Win + Java 8u212

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[tomcat] branch master updated: Fix test observed to fail consistently with NIO2 + Win + Java 8u212

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 8a81e7a  Fix test observed to fail consistently with NIO2 + Win + Java 8u212
8a81e7a is described below

commit 8a81e7a8db4337190464240e7e72fa3314356a40
Author: Mark Thomas <[hidden email]>
AuthorDate: Wed Aug 14 08:24:53 2019 +0100

    Fix test observed to fail consistently with NIO2 + Win + Java 8u212
---
 test/org/apache/coyote/http11/filters/TestChunkedInputFilter.java | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/test/org/apache/coyote/http11/filters/TestChunkedInputFilter.java b/test/org/apache/coyote/http11/filters/TestChunkedInputFilter.java
index 91ec506..86e574e 100644
--- a/test/org/apache/coyote/http11/filters/TestChunkedInputFilter.java
+++ b/test/org/apache/coyote/http11/filters/TestChunkedInputFilter.java
@@ -392,8 +392,12 @@ public class TestChunkedInputFilter extends TomcatBaseTest {
         request += SimpleHttpClient.CRLF + chunks + "0" + SimpleHttpClient.CRLF
                 + SimpleHttpClient.CRLF;
 
-        TrailerClient client = new TrailerClient(tomcat.getConnector()
-                .getLocalPort());
+        TrailerClient client = new TrailerClient(tomcat.getConnector().getLocalPort());
+        // Need to use the content length here as variations in Connector and
+        // JVM+OS behaviour mean that in some circumstances the client may see
+        // an IOException rather than the response body when the server closes
+        // the connection.
+        client.setUseContentLength(true);
         client.setRequest(new String[] { request });
 
         Exception processException = null;


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]