Jackie-Jiang commented on code in PR #14602: URL: https://github.com/apache/pinot/pull/14602#discussion_r1872007205
########## pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/QueryQuotaClusterIntegrationTest.java: ########## @@ -234,30 +235,44 @@ public void testApplicationAndDatabaseQueryQuotaWithTableQueryQuotaWithExtraBrok * Then runs the query load with double the max rate and expects queries to fail due to quota breach. * @param maxRate max rate allowed by the quota */ - void testQueryRate(float maxRate) - throws Exception { + void testQueryRate(int maxRate) { verifyQuotaUpdate(maxRate); runQueries(maxRate, false); //increase the qps and some of the queries should be throttled. runQueries(maxRate * 2, true); } - void testQueryRateOnBroker(float maxRate) - throws Exception { + void testQueryRateOnBroker(float maxRate) { verifyQuotaUpdate(maxRate); runQueriesOnBroker(maxRate, false); //increase the qps and some of the queries should be throttled. runQueriesOnBroker(maxRate * 2, true); } + private static void sleep(long end, double iterationsLeft) { + long duration = (long) Math.max(Math.ceil((end - System.currentTimeMillis()) / iterationsLeft), 0); Review Comment: We can read `System.currentTimeMillis()` only once. Some javadoc can help explain the logic ########## pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/QueryQuotaClusterIntegrationTest.java: ########## @@ -234,30 +235,44 @@ public void testApplicationAndDatabaseQueryQuotaWithTableQueryQuotaWithExtraBrok * Then runs the query load with double the max rate and expects queries to fail due to quota breach. * @param maxRate max rate allowed by the quota */ - void testQueryRate(float maxRate) - throws Exception { + void testQueryRate(int maxRate) { verifyQuotaUpdate(maxRate); runQueries(maxRate, false); //increase the qps and some of the queries should be throttled. runQueries(maxRate * 2, true); } - void testQueryRateOnBroker(float maxRate) - throws Exception { + void testQueryRateOnBroker(float maxRate) { verifyQuotaUpdate(maxRate); runQueriesOnBroker(maxRate, false); //increase the qps and some of the queries should be throttled. runQueriesOnBroker(maxRate * 2, true); } + private static void sleep(long end, double iterationsLeft) { Review Comment: I'd suggest not swallow `InterruptedException` as it is unexpected -- 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: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org