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

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


The following commit(s) were added to refs/heads/master by this push:
     new b0440e3f6   The flaky test testBatchMessageThreadPoolSize was timing 
out because:
b0440e3f6 is described below

commit b0440e3f61aba90bab75e7a3f97bb1895973bf8f
Author: Junkai Xue <[email protected]>
AuthorDate: Fri Mar 6 22:20:33 2026 -0800

      The flaky test testBatchMessageThreadPoolSize was timing out because:
    
      1. The test uses a state model factory with a 2000ms delay per state 
transition
      2. It creates 10 DBs with 10 partitions each (100 total partitions)
      3. Only 1 participant is running with a thread pool of 5 threads
      4. The BestPossibleExternalViewVerifier was using 
TestHelper.DEFAULT_REBALANCE_PROCESSING_WAIT_TIME (1500ms) which was far too 
short
    
      With 100 partitions, 2000ms delay each, and 5 threads, it takes at least 
40 seconds just for state transitions. The 1500ms timeout was causing the test 
to consistently time out at 900 seconds (the CI
      timeout).
    
      The fix: Increased the timeout from 1500ms to 300000ms (5 minutes) in 
helix-core/src/test/java/org/apache/helix/messaging/handling/TestResourceThreadpoolSize.java:213.
---
 .../helix/messaging/handling/TestResourceThreadpoolSize.java  | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git 
a/helix-core/src/test/java/org/apache/helix/messaging/handling/TestResourceThreadpoolSize.java
 
b/helix-core/src/test/java/org/apache/helix/messaging/handling/TestResourceThreadpoolSize.java
index c9c47236e..e51525de9 100644
--- 
a/helix-core/src/test/java/org/apache/helix/messaging/handling/TestResourceThreadpoolSize.java
+++ 
b/helix-core/src/test/java/org/apache/helix/messaging/handling/TestResourceThreadpoolSize.java
@@ -204,16 +204,13 @@ public class TestResourceThreadpoolSize extends 
ZkStandAloneCMTestBase {
     ThreadPoolExecutor executor = (ThreadPoolExecutor) 
(helixExecutor._batchMessageExecutorService);
     Assert.assertNotNull(executor);
 
-    // This ASSERT invariant is not true.
-    // _batchMessageExecutorService is created as newCachedThreadPool().
-    // which will re-use existing threads if they are available. 
-    // So there is no gurantee that new threads will be created for each new 
database
-    // Assert.assertTrue(executor.getPoolSize() >= numberOfDbs);
-
+    // Use longer timeout since the state model factory has 2000ms delay per 
transition,
+    // and with 10 DBs x 10 partitions = 100 partitions and only 5 threads in 
the pool,
+    // it takes significant time for all state transitions to complete
     BestPossibleExternalViewVerifier verifier =
         new BestPossibleExternalViewVerifier.Builder(CLUSTER_NAME)
             .setZkClient(_gZkClient)
-            
.setWaitTillVerify(TestHelper.DEFAULT_REBALANCE_PROCESSING_WAIT_TIME)
+            .setWaitTillVerify(300000)
             .build();
     Assert.assertTrue(verifier.verifyByPolling());
   }

Reply via email to