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:23 UTC
[tomcat] branch main 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 main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push:
new 99d3559 Refactor check of cluster start to improve robustness
99d3559 is described below
commit 99d35599fa16dfa1f9bedc021b30ba3e1bf658f3
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