This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/11.0.x by this push:
new f100f961a5 Fix race in HTTP/2 async CLOSE_CLEAN tests
f100f961a5 is described below
commit f100f961a53323c36667f3e930448f2f49acaaff
Author: Mark Thomas <[email protected]>
AuthorDate: Mon Nov 30 13:06:43 2026 +0000
Fix race in HTTP/2 async CLOSE_CLEAN tests
The test released its latch from inside the servlet, but the processor is
only added to the waiting processors once service() returns. Wait for the
processor to be registered before continuing.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
---
.../apache/coyote/http2/TestStreamProcessorAsyncCloseClean.java | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git
a/test/org/apache/coyote/http2/TestStreamProcessorAsyncCloseClean.java
b/test/org/apache/coyote/http2/TestStreamProcessorAsyncCloseClean.java
index c676e075a5..feb15daa8f 100644
--- a/test/org/apache/coyote/http2/TestStreamProcessorAsyncCloseClean.java
+++ b/test/org/apache/coyote/http2/TestStreamProcessorAsyncCloseClean.java
@@ -236,6 +236,14 @@ public class TestStreamProcessorAsyncCloseClean extends
Http2TestBase {
if (!inService.await(WAIT_LIMIT, TimeUnit.MILLISECONDS)) {
Assert.fail("Request did not reach the servlet");
}
+ // The latch is released from inside the servlet. The processor is
only added to the waiting processors once
+ // service() has returned on the container thread. Wait for that, else
the tests can check, or send data,
+ // before the processor is registered.
+ long end = System.currentTimeMillis() + WAIT_LIMIT;
+ while (waitingProcessors() == 0 && System.currentTimeMillis() < end) {
+ Thread.sleep(10);
+ }
+ Assert.assertEquals(1, waitingProcessors());
return asyncContext.get();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]