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


##########
pinot-controller/src/test/java/org/apache/pinot/controller/ControllerConfTest.java:
##########
@@ -288,8 +189,15 @@ private int getRandomMinutes() {
     return 1 + RAND.nextInt(10);
   }
 
-  private String getRandomString() {
-    return RandomStringUtils.randomAlphanumeric(5);
+  @Test
+  public void invalidFrequencyPeriodShouldFallBackToDefault() {
+    Map<String, Object> controllerConfig = new HashMap<>();
+    controllerConfig.put(RETENTION_MANAGER_FREQUENCY_PERIOD, 
"notAValidPeriod");
+    ControllerConf conf = new ControllerConf(controllerConfig);
+    // Invalid period should fall back to the default value
+    Assert.assertEquals(conf.getRetentionControllerFrequencyInSeconds(),
+        (int) TimeUnit.SECONDS.convert(
+            
TimeUtils.convertPeriodToMillis(DEFAULT_RETENTION_MANAGER_FREQUENCY_PERIOD), 
TimeUnit.MILLISECONDS));
   }

Review Comment:
   `invalidFrequencyPeriodShouldFallBackToDefault()` verifies the returned 
default value, but it no longer asserts that the invalid period is recorded in 
`conf.getInvalidConfigs()` (the behavior implemented by 
`isValidPeriodWithLogging`). Adding an assertion that the map contains the key 
(and optionally validates the message) would better protect the invalid-config 
reporting behavior from regressions.



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