XComp commented on a change in pull request #19121:
URL: https://github.com/apache/flink/pull/19121#discussion_r829133062
##########
File path:
flink-kubernetes/src/test/java/org/apache/flink/kubernetes/highavailability/KubernetesStateHandleStoreTest.java
##########
@@ -803,6 +803,34 @@ public void testRemove() throws Exception {
};
}
+ @Test
+ public void testRemoveOfNonExistingState() throws Exception {
+ new Context() {
+ {
+ runTest(
+ () -> {
+ leaderCallbackGrantLeadership();
+
+ final KubernetesStateHandleStore<
+
TestingLongStateHandleHelper.LongStateHandle>
+ store =
+ new KubernetesStateHandleStore<>(
+ flinkKubeClient,
+ LEADER_CONFIGMAP_NAME,
+ longStateStorage,
+ filter,
+ LOCK_IDENTITY);
+ assertThat(store.getAllAndLock().size(), is(0));
+ assertThat(store.releaseAndTryRemove(key),
is(true));
+ assertThat(store.getAllAndLock().size(), is(0));
+
+ // State should also be discarded.
Review comment:
Not sure which count you're referring to, but the comment itself is
wrong. The count for a non-existing resource should always be 0 (before and
after the `releasseAndTryRemove` call) and no discardState should have been
called, i.e. the test evaluates `getGlobalDiscardCount` to return `0`.
--
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]