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 ddb0f66 Prevent test hanging if it fails.
ddb0f66 is described below
commit ddb0f6634259ee227d59b64aca82db8922ec2a83
Author: Mark Thomas <[email protected]>
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 7acedaa..5049293 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: [email protected]
For additional commands, e-mail: [email protected]