jackjlli commented on a change in pull request #8071:
URL: https://github.com/apache/pinot/pull/8071#discussion_r792929024



##########
File path: 
pinot-controller/src/test/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManagerTest.java
##########
@@ -816,6 +819,48 @@ public void testSegmentReplacementForRefresh()
     Assert.assertEquals(new 
HashSet<>(ControllerTestUtils.getHelixResourceManager()
             .getSegmentsFor(OFFLINE_SEGMENTS_REPLACE_TEST_REFRESH_TABLE_NAME, 
true)),
         new HashSet<>(Arrays.asList("s9", "s10", "s11")));
+
+    // Call revert segment replacements
+    ControllerTestUtils.getHelixResourceManager()
+        
.revertReplaceSegments(OFFLINE_SEGMENTS_REPLACE_TEST_REFRESH_TABLE_NAME, 
lineageEntryId3, false);
+    waitForSegmentsToDelete(OFFLINE_SEGMENTS_REPLACE_TEST_REFRESH_TABLE_NAME, 
3, MAX_TIMEOUT_IN_MILLISECOND);
+    Assert.assertEquals(new 
HashSet<>(ControllerTestUtils.getHelixResourceManager()
+            .getSegmentsFor(OFFLINE_SEGMENTS_REPLACE_TEST_REFRESH_TABLE_NAME, 
true)),
+        new HashSet<>(Arrays.asList("s3", "s4", "s5")));
+
+    // Re-upload (s9, s10, s11) to test the segment clean up from 
startReplaceSegments

Review comment:
       Thanks for the explanation! Could you update the comment to the code as 
well? I guess ppl will also have the same question on it. You can also 
elaborate on L848 that (s9, s10, s11) will be removed after making the end call.




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