georgew5656 commented on code in PR #15372:
URL: https://github.com/apache/druid/pull/15372#discussion_r1394842148
##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/IndexTaskTest.java:
##########
@@ -2690,6 +2691,100 @@ public void
testErrorWhenDropFlagTrueAndOverwriteFalse() throws Exception
);
}
+ @Test
+ public void testDontCleanupIndexTask() throws Exception
+ {
+ new IndexTask(
+ null,
+ null,
+ null,
+ "dataSource",
+ null,
+ createDefaultIngestionSpec(
+ jsonMapper,
+ temporaryFolder.newFolder(),
+ new UniformGranularitySpec(
+ Granularities.MINUTE,
+ Granularities.MINUTE,
+
Collections.singletonList(Intervals.of("2014-01-01/2014-01-02"))
+ ),
+ null,
+ createTuningConfigWithMaxRowsPerSegment(10, true),
+ false,
+ false
+ ),
+ null,
+ 0,
+ false
+ ).cleanUp(null, null);
Review Comment:
the tests are checking the shouldCleanup variable. I couldn't think of a way
to mock the AbstractBatchTask.cleanup method only so I just treat the lack of a
exception as the test succeeding, do you have a better idea?
--
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]