Hisoka-X commented on code in PR #9552:
URL: https://github.com/apache/seatunnel/pull/9552#discussion_r2207357426
##########
seatunnel-engine/seatunnel-engine-server/src/test/java/org/apache/seatunnel/engine/server/checkpoint/CheckpointStorageTest.java:
##########
@@ -177,4 +179,30 @@ public void testStreamJobWithCancel() throws
CheckpointStorageException, Interru
checkpointStorage.getAllCheckpoints(String.valueOf(jobId));
Assertions.assertEquals(0, allCheckpoints.size());
}
+
+ @Test
+ public void testBatchJobResetCheckpointStorage() throws
CheckpointStorageException {
+ long jobId = System.currentTimeMillis();
+ CheckpointConfig checkpointConfig =
+
server.getSeaTunnelConfig().getEngineConfig().getCheckpointConfig();
+
server.getSeaTunnelConfig().getEngineConfig().setCheckpointConfig(checkpointConfig);
+
+ CheckpointStorage checkpointStorage =
+ FactoryUtil.discoverFactory(
+ Thread.currentThread().getContextClassLoader(),
+ CheckpointStorageFactory.class,
+ checkpointConfig.getStorage().getStorage())
+
.create(checkpointConfig.getStorage().getStoragePluginConfig());
+
+ startJob(jobId, BATCH_CONF_WITHOUT_CHECKPOINT_INTERVAL_PATH, false);
+ await().atMost(120000, TimeUnit.MILLISECONDS)
+ .untilAsserted(
+ () ->
+ Assertions.assertEquals(
+
server.getCoordinatorService().getJobStatus(jobId),
+ JobStatus.FINISHED));
+ List<PipelineState> allCheckpoints =
+ checkpointStorage.getAllCheckpoints(String.valueOf(jobId));
Review Comment:
Before this PR, this test case should also be able to run normally, so our
test case also needs to verify that the checkpoint storage has not been
accessed. Perhaps we can create a checkpoint storage class only for testing and
record the number of times it is called to verify this modification.
--
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]