rkhachatryan commented on code in PR #20313: URL: https://github.com/apache/flink/pull/20313#discussion_r933099304
########## 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: The test checks the set of checkpoints that are not used anymore. This set doesn't depend on the restore mode. Restore mode was added to `registerAllAfterRestored` earlier; it affects whether the unused state entry will be discarded or simply removed from the in-memory collection. -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org