Author: markt
Date: Mon May 23 11:28:14 2016
New Revision: 1745143
URL: http://svn.apache.org/viewvc?rev=1745143&view=rev
Log:
Correct a timing issue that could trigger incorrect test failures
Modified:
tomcat/trunk/test/org/apache/coyote/http2/TestHttp2Section_5_1.java
Modified: tomcat/trunk/test/org/apache/coyote/http2/TestHttp2Section_5_1.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/coyote/http2/TestHttp2Section_5_1.java?rev=1745143&r1=1745142&r2=1745143&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/coyote/http2/TestHttp2Section_5_1.java
(original)
+++ tomcat/trunk/test/org/apache/coyote/http2/TestHttp2Section_5_1.java Mon May
23 11:28:14 2016
@@ -219,8 +219,9 @@ public class TestHttp2Section_5_1 extend
sendSimpleGetRequest(5);
- // Default connection window size is 64k - 1. Initial request will have
- // used 8k (56k -1).
+ // Default connection window size is 64k-1.
+ // Initial request will have used 8k leaving 56k-1.
+ // Stream window will be 64k-1.
// Expecting
// 1 * headers
// 56k-1 of body (7 * ~8k)
@@ -230,18 +231,23 @@ public class TestHttp2Section_5_1 extend
}
parser.readFrame(true);
+ Assert.assertTrue(output.getTrace(),
+ output.getTrace().contains("5-RST-[" +
+ Http2Error.REFUSED_STREAM.getCode() + "]"));
+ output.clearTrace();
+
+ // Connection window is zero.
+ // Stream window is 8k
+
// Release the remaining body
- sendWindowUpdate(0, (1 << 31) - 1);
- sendWindowUpdate(3, (1 << 31) - 1);
+ sendWindowUpdate(0, (1 << 31) - 2);
+ // Allow for the 8k still in the stream window
+ sendWindowUpdate(3, (1 << 31) - 8193);
// 192k of body (24 * 8k)
// 1 * error (could be in any order)
for (int i = 0; i < 24; i++) {
parser.readFrame(true);
}
-
- Assert.assertTrue(output.getTrace(),
- output.getTrace().contains("5-RST-[" +
- Http2Error.REFUSED_STREAM.getCode() + "]"));
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]