Jackie-Jiang commented on code in PR #16848:
URL: https://github.com/apache/pinot/pull/16848#discussion_r2414768377
##########
pinot-controller/src/test/java/org/apache/pinot/controller/helix/core/util/SegmentDeletionManagerTest.java:
##########
@@ -335,19 +345,39 @@ public void testRemoveDeletedSegmentsForGcsPinotFS()
pinotFS.mkdir(segmentURIForTable);
// Create dummy files
- URI tableUri2 = new
URI("fake://bucket/sc/managed/pinot/Deleted_Segments/table_2/");
+ URI tableUri2 = new URI("fake://bucket/sc/managed/pinot/" +
SegmentDeletionManager.DELETED_SEGMENTS + "/table_2/");
URI segment1ForTable2 = new URI(tableUri2.getPath() + "segment1" +
RETENTION_UNTIL_SEPARATOR + "201901010000");
URI segment2ForTable2 = new URI(tableUri2.getPath() + "segment1" +
RETENTION_UNTIL_SEPARATOR + "201801010000");
pinotFS.mkdir(tableUri2);
pinotFS.mkdir(segment1ForTable2);
pinotFS.mkdir(segment2ForTable2);
deletionManager1.removeAgedDeletedSegments(leadControllerManager);
- // all files should get deleted
- Assert.assertFalse(pinotFS.exists(tableUri2));
+
+ // All files should get deleted but the directory will be deleted in the
next run
+ TestUtils.waitForCondition((aVoid) -> {
+ try {
+ return pinotFS.listFiles(tableUri2, false).length == 0;
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }, 1000, 10000,
+ "Could not delete all the files for table_2");
+ Assert.assertTrue(pinotFS.exists(tableUri2));
// One file that doesn't meet retention criteria, and another file due to
the per attempt batch limit remains.
- Assert.assertEquals(pinotFS.listFiles(tableUri1, false).length, 2);
+ TestUtils.waitForCondition((aVoid) -> {
Review Comment:
This test is quite flaky. Can you please take a look?
Example failure run:
https://github.com/apache/pinot/actions/runs/18328901244/job/52199754487?pr=16966
--
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]