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

tballison pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tika.git


The following commit(s) were added to refs/heads/main by this push:
     new 6ab42aa835 TIKA-4991: wait for the body budget to drain between 
requests in MaxRequestSizeIntegrationTest (#3413)
6ab42aa835 is described below

commit 6ab42aa835bfa7cfb13bbe8f57033f974c3e2f7a
Author: Tim Allison <[email protected]>
AuthorDate: Sat Oct 24 12:59:46 2026 -0400

    TIKA-4991: wait for the body budget to drain between requests in 
MaxRequestSizeIntegrationTest (#3413)
---
 .../apache/tika/server/standard/MaxRequestSizeIntegrationTest.java  | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git 
a/tika-server/tika-server-standard/src/test/java/org/apache/tika/server/standard/MaxRequestSizeIntegrationTest.java
 
b/tika-server/tika-server-standard/src/test/java/org/apache/tika/server/standard/MaxRequestSizeIntegrationTest.java
index 0aba6d18dc..918505f076 100644
--- 
a/tika-server/tika-server-standard/src/test/java/org/apache/tika/server/standard/MaxRequestSizeIntegrationTest.java
+++ 
b/tika-server/tika-server-standard/src/test/java/org/apache/tika/server/standard/MaxRequestSizeIntegrationTest.java
@@ -130,6 +130,11 @@ public class MaxRequestSizeIntegrationTest extends 
IntegrationTestBase {
     /** Whatever a test did to the server, every request's share of the body 
budget comes back. */
     @AfterEach
     public void assertBudgetDrained() throws Exception {
+        awaitBudgetDrained();
+    }
+
+    // a request holds its share until Jetty completes it, which can lag the 
client seeing its status
+    private void awaitBudgetDrained() throws Exception {
         long deadline = System.nanoTime() + TimeUnit.SECONDS.toNanos(10);
         long inFlight;
         do {
@@ -150,6 +155,7 @@ public class MaxRequestSizeIntegrationTest extends 
IntegrationTestBase {
             boolean anyTooLarge = false;
             List<String> statuses = new ArrayList<>();
             for (Map.Entry<String, byte[]> e : PREAMBLES.entrySet()) {
+                awaitBudgetDrained();
                 String status = sendChunked(endpoint, e.getKey(), 
e.getValue());
                 statuses.add(e.getKey() + "=" + status);
                 // fail fast: each further hang would cost another socket 
timeout

Reply via email to