Copilot commented on code in PR #17752:
URL: https://github.com/apache/pinot/pull/17752#discussion_r2849281987


##########
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/ExactlyOnceKafkaRealtimeClusterIntegrationTest.java:
##########
@@ -71,6 +71,24 @@ protected int getNumKafkaBrokers() {
     return DEFAULT_TRANSACTION_NUM_KAFKA_BROKERS;
   }
 
+  @Override
+  protected int getKafkaStartMaxAttempts() {
+    // CI environments are resource-constrained; allow more retries for 
3-broker transactional quorum
+    return Boolean.parseBoolean(System.getenv("GITHUB_ACTIONS")) ? 5 : 
super.getKafkaStartMaxAttempts();
+  }

Review Comment:
   The environment variable GITHUB_ACTIONS is being parsed repeatedly (once per 
method call). Since these methods may be called multiple times during test 
setup and retry logic, consider caching the parsed value in a static final 
field to avoid redundant parsing. This would also make the code more 
maintainable and testable. For example:
   
   ```java
   private static final boolean IS_GITHUB_ACTIONS = 
Boolean.parseBoolean(System.getenv("GITHUB_ACTIONS"));
   ```
   
   Then use IS_GITHUB_ACTIONS in all three override methods.



-- 
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