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 b6a8953 Try to improve test reliability
b6a8953 is described below
commit b6a8953c428f19e0666c5f9aee91171cc287d69b
Author: Mark Thomas <[email protected]>
AuthorDate: Wed Dec 1 10:57:00 2021 +0000
Try to improve test reliability
---
.../group/interceptors/TestTcpFailureDetector.java | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git
a/test/org/apache/catalina/tribes/group/interceptors/TestTcpFailureDetector.java
b/test/org/apache/catalina/tribes/group/interceptors/TestTcpFailureDetector.java
index fb08670..ea68988 100644
---
a/test/org/apache/catalina/tribes/group/interceptors/TestTcpFailureDetector.java
+++
b/test/org/apache/catalina/tribes/group/interceptors/TestTcpFailureDetector.java
@@ -105,8 +105,20 @@ public class TestTcpFailureDetector {
channel2.start(Channel.MBR_RX_SEQ);
channel2.stop(Channel.SND_RX_SEQ);
channel2.start(Channel.MBR_TX_SEQ);
- //Thread.sleep(1000);
- Assert.assertEquals("Expecting member count to not be
equal",mbrlist1.members.size()+1,mbrlist2.members.size());
+ // Intermittent CI failure
+ // Allow up to 5 seconds for membership to reach expected state
+ int count = 0;
+ while (mbrlist1.members.size()+1 != mbrlist2.members.size() && count <
100) {
+ Thread.sleep(50);
+ count++;
+ }
+ // Ensure membership remains in expected state for the same period plus
+ // 1 second
+ count += 20;
+ while (count > 0) {
+ Assert.assertEquals("Expecting member count to not be
equal",mbrlist1.members.size()+1,mbrlist2.members.size());
+ count--;
+ }
channel1.stop(Channel.DEFAULT);
channel2.stop(Channel.DEFAULT);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]