morozov commented on code in PR #3794:
URL: https://github.com/apache/flink-cdc/pull/3794#discussion_r1881205315
##########
flink-cdc-connect/flink-cdc-source-connectors/flink-connector-mysql-cdc/src/test/java/org/apache/flink/cdc/connectors/mysql/source/assigners/state/PendingSplitsStateSerializerTest.java:
##########
@@ -102,6 +104,22 @@ public void testRepeatedSerializationCache() throws
Exception {
assertSame(ser1, ser3);
}
+ @Test
+ public void testOutputIsFinallyCleared() throws Exception {
+ final PendingSplitsStateSerializer serializer =
+ new
PendingSplitsStateSerializer(MySqlSplitSerializer.INSTANCE);
+
+ final byte[] ser1 = serializer.serialize(state);
+ state.serializedFormCache = null;
+
+ PendingSplitsState unsupportedState = new
UnsupportedPendingSplitsState();
+
+ assertThrows(IOException.class, () ->
serializer.serialize(unsupportedState));
+
+ final byte[] ser2 = serializer.serialize(state);
+ assertEquals(ser1.length, ser2.length);
Review Comment:
For some reason, they aren't the same regardless of the fix.
UPD: you're right. They are equal, they just need to be compared as arrays,
not objects.
--
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]