Jiayi-Liao edited a comment on pull request #15016: URL: https://github.com/apache/flink/pull/15016#issuecomment-785653274
@carp84 It took me some time to dig how to test this change, but unfortunately there may not be an easy way to achieve this. Take the `TtlListState` as an example, in `TtlStateTestBase`, Flink uses `TtlStateTestContextBase.isOriginalEmptyValue()` to test whether the state is cleared, which is `Objects.equals(emptyValue, getOriginal());` in TtlListState's testing. To test my change, I need to verify the result of `stateTable.get(currentNamespace);`, but unit testing uses `MockInternalKvState.getInternal()` which uses `computeIfAbsent(currentNamespace, n -> emptyValue.get())` and never returns null in `TtlListState`. If we want to test the change, we might need to change the `emptyValue` in `MockInternalListState`、`MockInternalMapState` and related `TtlStateTestContextBase`, which may affect a lot of tests. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected]
