Skip to content

Commit

Permalink
Speed up test.
Browse files Browse the repository at this point in the history
Fully reading body means Tomcat doesn't hang on shutdown waiting for the
writes to complete.
  • Loading branch information
markt-asf committed Jan 30, 2025
1 parent 73c067b commit a82aef3
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions test/org/apache/coyote/http2/TestRfc9218.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public void testPriority() throws Exception {

/*
* Add 8k to the connection window. Should clear the connection window over allocation and fully allocate 17
* with the remainder split equally between 17 and 21.
* with the remainder split proportionally between 19 and 21.
*/
sendWindowUpdate(0, 1024 * 8);
// Use try/catch as third read has been failing on some tests runs
Expand All @@ -177,6 +177,18 @@ public void testPriority() throws Exception {
trace = trace.replace("21-Body-1365\n", "");
Assert.assertEquals(0, trace.length());

// Test doesn't read the read of the body for streams 19 and 21.
// 19 - 5641 body left
// 21 - 4778 body left

// Add 16k to the connection window. Should fully allocate 19 and 21.
sendWindowUpdate(0, 1024 * 16);

try {
parser.readFrame();
parser.readFrame();
} catch (IOException ioe) {
// Dump for debugging purposes
ioe.printStackTrace();
}
}
}

0 comments on commit a82aef3

Please sign in to comment.