beobal commented on code in PR #3655:
URL: https://github.com/apache/cassandra/pull/3655#discussion_r1873013541


##########
test/unit/org/apache/cassandra/transport/ClientResourceLimitsTest.java:
##########
@@ -261,26 +284,39 @@ public void 
testOverloadedExceptionWhenGlobalLimitByMultiFrameMessage()
     {
         // Bump the per-endpoint limit to make sure we exhaust the global
         ClientResourceLimits.setEndpointLimit(HIGH_LIMIT);
-        testOverloadedException(() -> client(true, Ints.checkedCast(LOW_LIMIT 
/ 2)));
+        // test massage = 2/3 x
+        // emulated concurrent message = 2/3 x
+        // test massage + emulated concurrent message = 4/3 x > x set as a 
global limit
+        emulateInFlightConcurrentMessage(LOW_LIMIT * 2 / 3);
+        testOverloadedException(() -> client(true, Ints.checkedCast(LOW_LIMIT 
/ 2)), LOW_LIMIT * 2 / 3);
     }
 
     @Test
     public void testOverloadedExceptionWhenEndpointLimitByMultiFrameMessage()
     {
         // Make sure we can only exceed the per-endpoint limit
         ClientResourceLimits.setGlobalLimit(HIGH_LIMIT);
-        testOverloadedException(() -> client(true, Ints.checkedCast(LOW_LIMIT 
/ 2)));
+        // test massage = 2/3 x

Review Comment:
   nit: typo



##########
test/unit/org/apache/cassandra/transport/ClientResourceLimitsTest.java:
##########
@@ -261,26 +284,39 @@ public void 
testOverloadedExceptionWhenGlobalLimitByMultiFrameMessage()
     {
         // Bump the per-endpoint limit to make sure we exhaust the global
         ClientResourceLimits.setEndpointLimit(HIGH_LIMIT);
-        testOverloadedException(() -> client(true, Ints.checkedCast(LOW_LIMIT 
/ 2)));
+        // test massage = 2/3 x

Review Comment:
   nit: typo



##########
test/unit/org/apache/cassandra/transport/RateLimitingTest.java:
##########
@@ -155,7 +171,11 @@ private void testBytesInFlightOverload(int payloadSize) 
throws Exception
 
             
StorageService.instance.setNativeTransportRateLimitingEnabled(true);
             
ClientResourceLimits.GLOBAL_REQUEST_LIMITER.setRate(OVERLOAD_PERMITS_PER_SECOND,
 ticker);
-            ClientResourceLimits.setGlobalLimit(1);
+            // test massage = 1x

Review Comment:
   nit: typo



##########
test/unit/org/apache/cassandra/transport/RateLimitingTest.java:
##########
@@ -155,7 +171,11 @@ private void testBytesInFlightOverload(int payloadSize) 
throws Exception
 
             
StorageService.instance.setNativeTransportRateLimitingEnabled(true);
             
ClientResourceLimits.GLOBAL_REQUEST_LIMITER.setRate(OVERLOAD_PERMITS_PER_SECOND,
 ticker);
-            ClientResourceLimits.setGlobalLimit(1);
+            // test massage = 1x
+            // emulated concurrent message = 1.5x
+            // test massage + emulated concurrent message = 2.5x > 2x set as a 
global limit

Review Comment:
   nit: typo



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to