You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2021/11/18 12:51:27 UTC

[tomcat] branch 9.0.x updated: Refactor check of cluster start to improve robustness

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

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


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

commit f7cf97062d8d7207331ee7f29ba6f3a381f33e62
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org