masteryhx commented on code in PR #20313:
URL: https://github.com/apache/flink/pull/20313#discussion_r932892479
##########
flink-runtime/src/test/java/org/apache/flink/runtime/state/SharedStateRegistryTest.java:
##########
@@ -182,20 +194,113 @@ public void testRegisterChangelogStateBackendHandles()
throws InterruptedExcepti
}
@Test
- public void testUnregisterUnusedState() {
+ public void testUnregisterUnusedSavepointState() {
SharedStateRegistry sharedStateRegistry = new
SharedStateRegistryImpl();
TestingStreamStateHandle handle = new TestingStreamStateHandle();
- sharedStateRegistry.registerReference(new
SharedStateRegistryKey("first"), handle, 1L);
- sharedStateRegistry.registerReference(new
SharedStateRegistryKey("first"), handle, 2L);
- sharedStateRegistry.registerReference(new
SharedStateRegistryKey("first"), handle, 3L);
+
+ registerInitialCheckpoint(
+ sharedStateRegistry,
+ RESTORED_STATE_ID,
+ CheckpointProperties.forSavepoint(false,
SavepointFormatType.NATIVE));
+
+ sharedStateRegistry.registerReference(
Review Comment:
I am a bit confused about the test.
The default setting of restore mode in this test is NO_CLAIM mode.
So the mock and the deletion shouldn't occur in the default mode?
BTW, I think we may need to test CLAIM mode and NO_CLAIM mode both.
WDYT?
--
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]