This is an automated email from the ASF dual-hosted git repository.
janhoy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/main by this push:
new 2093185efaf SOLR-18174 Fix test race condition failure in
AsyncTrackerSemaphoreLeakTest (#4331)
2093185efaf is described below
commit 2093185efaffa5e6677125c54db7fd3151bb6bf1
Author: Jan Høydahl <[email protected]>
AuthorDate: Mon Apr 27 23:44:12 2026 +0200
SOLR-18174 Fix test race condition failure in AsyncTrackerSemaphoreLeakTest
(#4331)
---
.../solr/handler/component/AsyncTrackerSemaphoreLeakTest.java | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git
a/solr/core/src/test/org/apache/solr/handler/component/AsyncTrackerSemaphoreLeakTest.java
b/solr/core/src/test/org/apache/solr/handler/component/AsyncTrackerSemaphoreLeakTest.java
index 1ff3ec542ed..fb04ec1ef67 100644
---
a/solr/core/src/test/org/apache/solr/handler/component/AsyncTrackerSemaphoreLeakTest.java
+++
b/solr/core/src/test/org/apache/solr/handler/component/AsyncTrackerSemaphoreLeakTest.java
@@ -204,7 +204,16 @@ public class AsyncTrackerSemaphoreLeakTest extends
SolrCloudTestCase {
+ " fires synchronously on the IO thread before onComplete can
release().");
}
- int permitsAfterFailures = testClient.asyncTrackerAvailablePermits();
+ // Poll briefly: apiFutures complete on the executor thread, but
completeListener fires on
+ // Jetty's IO thread after response listeners, so allOf().get() can race
ahead of release().
+ int permitsAfterFailures;
+ long deadline = System.nanoTime() + TimeUnit.SECONDS.toNanos(5);
+ do {
+ permitsAfterFailures = testClient.asyncTrackerAvailablePermits();
+ if (permitsAfterFailures == MAX_PERMITS) break;
+ //noinspection BusyWait
+ Thread.sleep(10);
+ } while (System.nanoTime() < deadline);
log.info("Permits after retries: {}/{}", permitsAfterFailures,
MAX_PERMITS);
assertEquals(
"All permits should be restored after retries complete",