You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ji...@apache.org on 2026/09/30 01:39:35 UTC

(iotdb) branch master updated: Fix flaky heartbeat executor bound test (#18773)

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

jt2594838 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 50d86cf4161 Fix flaky heartbeat executor bound test (#18773)
50d86cf4161 is described below

commit 50d86cf4161a10baff14e17593321b2ddaa5f2d3
Author: Caideyipi <87...@users.noreply.github.com>
AuthorDate: Wed Sep 30 09:39:29 2026 +0800

    Fix flaky heartbeat executor bound test (#18773)
---
 .../SubscriptionConsumerHeartbeatIsolationTest.java     | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/iotdb-client/subscription/src/test/java/org/apache/iotdb/session/subscription/consumer/base/SubscriptionConsumerHeartbeatIsolationTest.java b/iotdb-client/subscription/src/test/java/org/apache/iotdb/session/subscription/consumer/base/SubscriptionConsumerHeartbeatIsolationTest.java
index 1c7d0af6b66..842f7e7daf2 100644
--- a/iotdb-client/subscription/src/test/java/org/apache/iotdb/session/subscription/consumer/base/SubscriptionConsumerHeartbeatIsolationTest.java
+++ b/iotdb-client/subscription/src/test/java/org/apache/iotdb/session/subscription/consumer/base/SubscriptionConsumerHeartbeatIsolationTest.java
@@ -120,16 +120,17 @@ public class SubscriptionConsumerHeartbeatIsolationTest {
     final CountDownLatch releaseTasks = new CountDownLatch(1);
     final List<Future<?>> futures = new ArrayList<>();
     try {
-      for (int i = 0; i < maximumPoolSize; i++) {
-        futures.add(
-            SubscriptionExecutorServiceManager.submitProviderHeartbeat(() -> await(releaseTasks)));
-      }
-      for (int i = 0; i < queueCapacity; i++) {
-        futures.add(
-            SubscriptionExecutorServiceManager.submitProviderHeartbeat(() -> await(releaseTasks)));
+      // The executor is shared, so other heartbeat tasks may consume capacity concurrently.
+      for (int i = 0; i <= maximumPoolSize + queueCapacity; i++) {
+        final Future<?> future =
+            SubscriptionExecutorServiceManager.submitProviderHeartbeat(() -> await(releaseTasks));
+        if (Objects.isNull(future)) {
+          break;
+        }
+        futures.add(future);
       }
 
-      Assert.assertNull(SubscriptionExecutorServiceManager.submitProviderHeartbeat(() -> {}));
+      Assert.assertTrue(futures.size() <= maximumPoolSize + queueCapacity);
     } finally {
       releaseTasks.countDown();
       for (final Future<?> future : futures) {