You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2021/02/26 20:22:49 UTC
[GitHub] [flink] pnowojski commented on a change in pull request #15036: [FLINK-21517][tests] Test harnesses should not bypass serialization stack for events
pnowojski commented on a change in pull request #15036:
URL: https://github.com/apache/flink/pull/15036#discussion_r583896610
##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/io/network/api/writer/RecordOrEventCollectingResultPartitionWriter.java
##########
@@ -48,7 +50,16 @@ public RecordOrEventCollectingResultPartitionWriter(
@Override
public void broadcastEvent(AbstractEvent event, boolean isPriorityEvent) throws IOException {
- output.add(event);
+ // Go through the serialization/deserialization to provide better test coverage in the
+ // unit tests using test harnesses. Otherwise bugs in event serialisation would be only
+ // visible in ITCases or end to end tests.
+ try (BufferConsumer eventBufferConsumer =
+ EventSerializer.toBufferConsumer(event, isPriorityEvent)) {
+ AbstractEvent deserializedEvent =
+ EventSerializer.fromBuffer(
+ eventBufferConsumer.build(), getClass().getClassLoader());
Review comment:
Yes, good catch, I've forgotten about it.
----------------------------------------------------------------
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:
users@infra.apache.org