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 2023/05/09 19:42:34 UTC

[tomcat] 03/03: MacOS seems to need longer for the test to complete

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

commit 4839d6997992f2615eb36b371c88745a43ac2ad7
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue May 9 20:41:53 2023 +0100

    MacOS seems to need longer for the test to complete
---
 test/org/apache/catalina/filters/TestRateLimitFilter.java | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/test/org/apache/catalina/filters/TestRateLimitFilter.java b/test/org/apache/catalina/filters/TestRateLimitFilter.java
index bf6c397972..b47e67ed60 100644
--- a/test/org/apache/catalina/filters/TestRateLimitFilter.java
+++ b/test/org/apache/catalina/filters/TestRateLimitFilter.java
@@ -71,7 +71,14 @@ public class TestRateLimitFilter extends TomcatBaseTest {
         TestClient tc3 = new TestClient(rateLimitFilter, filterChain, "10.20.20.20", 200, 20);
         TestClient tc4 = new TestClient(rateLimitFilter, filterChain, "10.20.20.40", 200, 40);
 
-        Thread.sleep(5000);
+        // Sleep for up to 10s for clients to complete
+        int count = 0;
+        while (count < 100 && (tc1.results[24] == 0 || tc2.results[49] == 0 || tc3.results[allowedRequests - 1] == 0 ||
+                tc3.results[allowedRequests] == 0 || tc3.results[allowedRequests - 1] == 0 ||
+                tc4.results[allowedRequests] == 0)) {
+            Thread.sleep(100);
+            count++;
+        }
 
         Assert.assertEquals(200, tc1.results[24]); // only 25 requests made, all allowed
 


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