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

remm 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 a266f95  Prevent test hanging if it fails.
a266f95 is described below

commit a266f953a6ebaa026d88b35f3370f8a0395c44fd
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Mar 4 16:52:27 2020 +0000

    Prevent test hanging if it fails.
---
 test/org/apache/coyote/http2/TestLargeUpload.java | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/test/org/apache/coyote/http2/TestLargeUpload.java 
b/test/org/apache/coyote/http2/TestLargeUpload.java
index ca1ed0e..ac38b92 100644
--- a/test/org/apache/coyote/http2/TestLargeUpload.java
+++ b/test/org/apache/coyote/http2/TestLargeUpload.java
@@ -100,11 +100,14 @@ public class TestLargeUpload extends Http2TestBase {
             byte[] buf = new byte[8192];
             InputStream is = req.getInputStream();
             int n = is.read(buf);
-            while (n > 0) {
-                read += n;
-                n = is.read(buf);
+            try {
+                while (n > 0) {
+                    read += n;
+                    n = is.read(buf);
+                }
+            } finally {
+                done.countDown();
             }
-            done.countDown();
             if (read != bodySize * bodyCount) {
                 resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
             } else {


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

Reply via email to