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

markt pushed a commit to branch 10.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/10.0.x by this push:
     new 5a2b573  Refactor check of cluster start to improve robustness
5a2b573 is described below

commit 5a2b57368ce6157711f3b72552efe3031fe25360
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Nov 18 12:49:56 2021 +0000

    Refactor check of cluster start to improve robustness
    
    BuiltBot tests were sometime failing when sending messages because there
    were no other nodes in the cluster.
---
 .../tribes/group/interceptors/TestOrderInterceptor.java  | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git 
a/test/org/apache/catalina/tribes/group/interceptors/TestOrderInterceptor.java 
b/test/org/apache/catalina/tribes/group/interceptors/TestOrderInterceptor.java
index 824a4ce..63cf646 100644
--- 
a/test/org/apache/catalina/tribes/group/interceptors/TestOrderInterceptor.java
+++ 
b/test/org/apache/catalina/tribes/group/interceptors/TestOrderInterceptor.java
@@ -81,10 +81,20 @@ public class TestOrderInterceptor {
         for ( int i=0; i<channelCount; i++ ) {
           threads[i].start();
         }
-        for ( int i=0; i<channelCount; i++ ) {
-          threads[i].join();
+
+        int totalSleep = 0;
+
+        for (int i = 0; i < channelCount; i++) {
+            Member[] m = channels[i].getMembers();
+            while (m == null || m.length < channelCount - 1) {
+                totalSleep += 50;
+                if (totalSleep > 60000) {
+                    Assert.fail("Cluster took more than 60s to start");
+                }
+                Thread.sleep(50);
+                m = channels[i].getMembers();
+            }
         }
-        Thread.sleep(1500);
     }
 
     @Test

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to