npawar commented on a change in pull request #4278: Add OfflineSegmentIntervalChecker to PeriodicTasksIntegrationTests URL: https://github.com/apache/incubator-pinot/pull/4278#discussion_r290949791
########## File path: pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/ControllerPeriodicTasksIntegrationTests.java ########## @@ -472,7 +474,26 @@ public void afterBrokerResourceValidationManagerTest(ITestContext context) dropOfflineTable(table2); } - // TODO: tests for other ControllerPeriodicTasks (RetentionManager, OfflineSegmentIntervalChecker, RealtimeSegmentValidationManager) + @Test + public void testOfflineSegmentIntervalChecker() + throws Exception { + OfflineSegmentIntervalChecker offlineSegmentIntervalChecker = _controllerStarter.getOfflineSegmentIntervalChecker(); + ValidationMetrics validationMetrics = offlineSegmentIntervalChecker.getValidationMetrics(); + + // Wait until OfflineSegmentIntervalChecker gets executed + TestUtils.waitForCondition( + input -> validationMetrics.getValueOfGuage("pinot.controller.mytable_OFFLINE.SegmentCount") > 0, 60_000, + "Timed out waiting for OfflineSegmentIntervalChecker"); + + // Test the validation metrics values updated by OfflineSegmentIntervalChecker against the known values + // from segment metadata + Assert.assertEquals(validationMetrics.getValueOfGuage("pinot.controller.mytable_OFFLINE.SegmentCount"), 12); Review comment: can we add constants for SegmentCount, missingSegmentCount, TotalDocumentCount (and maybe other such magic strings) in ValidationMetrics, and reuse those here? ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org