This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new a8f737f4bc Reduce test runtime
a8f737f4bc is described below
commit a8f737f4bcca4f43cdfe421390ff02b1496d066a
Author: Mark Thomas <[email protected]>
AuthorDate: Tue Oct 20 19:02:53 2026 +0100
Reduce test runtime
Co-authored by: Codex / GPT-6.1-Sol-High
---
.../filters/TestRateLimitFilterWithExactRateLimiter.java | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git
a/test/org/apache/catalina/filters/TestRateLimitFilterWithExactRateLimiter.java
b/test/org/apache/catalina/filters/TestRateLimitFilterWithExactRateLimiter.java
index 47fdf1fcd6..d0b496f779 100644
---
a/test/org/apache/catalina/filters/TestRateLimitFilterWithExactRateLimiter.java
+++
b/test/org/apache/catalina/filters/TestRateLimitFilterWithExactRateLimiter.java
@@ -59,11 +59,12 @@ public class TestRateLimitFilterWithExactRateLimiter
extends TomcatBaseTest {
System.out.printf("Sleeping %d millis for the next time bucket to
start\n", Long.valueOf(sleepTime));
Thread.sleep(sleepTime);
- TestClient tc1 = new TestClient(rateLimitFilter, filterChain,
"10.20.20.5", 50, 5); // TPS: 5
- TestClient tc2 = new TestClient(rateLimitFilter, filterChain,
"10.20.20.10", 100, 10); // TPS: 10
+ // Stop each client after the last response checked below.
+ TestClient tc1 = new TestClient(rateLimitFilter, filterChain,
"10.20.20.5", 25, 5); // TPS: 5
+ TestClient tc2 = new TestClient(rateLimitFilter, filterChain,
"10.20.20.10", 50, 10); // TPS: 10
- TestClient tc3 = new TestClient(rateLimitFilter, filterChain,
"10.20.20.20", 200, 20); // TPS: 20
- TestClient tc4 = new TestClient(rateLimitFilter, filterChain,
"10.20.20.40", 400, 40); // TPS: 40
+ TestClient tc3 = new TestClient(rateLimitFilter, filterChain,
"10.20.20.20", allowedRequests + 1, 20); // TPS: 20
+ TestClient tc4 = new TestClient(rateLimitFilter, filterChain,
"10.20.20.40", allowedRequests + 1, 40); // TPS: 40
tc1.join();
tc2.join();
tc3.join();
@@ -164,7 +165,7 @@ public class TestRateLimitFilterWithExactRateLimiter
extends TomcatBaseTest {
*/
long expectedDuration = (requestIndex + 1) * timePerRequest;
long duration = (System.nanoTime() - start) / 1000000;
- if (expectedDuration > duration) {
+ if (requestIndex + 1 < requests && expectedDuration > duration) {
sleep(expectedDuration - duration);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]