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 2026/08/12 11:10:21 UTC
(tomcat) branch main updated: Add re-try attempt after observing likely timing related test failures
This is an automated email from the ASF dual-hosted git repository.
markt-asf 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 a50643fcb3 Add re-try attempt after observing likely timing related test failures
a50643fcb3 is described below
commit a50643fcb3a3b0233328b90267fd160601c6f048
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Aug 12 12:10:14 2026 +0100
Add re-try attempt after observing likely timing related test failures
---
.../EncryptionInterceptorBaseTest.java | 26 +++++++++++++++++++---
1 file changed, 23 insertions(+), 3 deletions(-)
diff --git a/test/org/apache/catalina/tribes/group/interceptors/EncryptionInterceptorBaseTest.java b/test/org/apache/catalina/tribes/group/interceptors/EncryptionInterceptorBaseTest.java
index c3db40dc28..124ea16b9e 100644
--- a/test/org/apache/catalina/tribes/group/interceptors/EncryptionInterceptorBaseTest.java
+++ b/test/org/apache/catalina/tribes/group/interceptors/EncryptionInterceptorBaseTest.java
@@ -34,6 +34,7 @@ import org.apache.catalina.tribes.group.ChannelInterceptorBase;
import org.apache.catalina.tribes.group.InterceptorPayload;
import org.apache.catalina.tribes.io.ChannelData;
import org.apache.catalina.tribes.io.XByteBuffer;
+import org.apache.tomcat.util.ExceptionUtils;
public class EncryptionInterceptorBaseTest {
@@ -56,9 +57,28 @@ public class EncryptionInterceptorBaseTest {
@AfterClass
public static void cleanup() {
- File f = new File(MESSAGE_FILE);
- if (f.isFile()) {
- Assert.assertTrue(f.delete());
+ int attempts = 0;
+ int maxAttempts = 2;
+ while (attempts < maxAttempts) {
+ attempts++;
+ try {
+ File f = new File(MESSAGE_FILE);
+ if (f.isFile()) {
+ Assert.assertTrue(f.delete());
+ }
+ } catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
+ if (attempts < maxAttempts) {
+ // Brief delay before re-try
+ try {
+ Thread.sleep(50);
+ } catch (InterruptedException e) {
+ // Ignore. The delay will just be shorter than expected.
+ }
+ } else {
+ throw t;
+ }
+ }
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org