Github user NicoK commented on a diff in the pull request:
https://github.com/apache/flink/pull/5105#discussion_r156426879
--- Diff:
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/api/writer/RecordWriterTest.java
---
@@ -155,13 +159,13 @@ public Void call() throws Exception {
recordWriter.clearBuffers();
// Verify that buffer have been requested, but only one
has been written out.
- verify(bufferProvider,
times(2)).requestBufferBlocking();
+ verify(bufferProvider,
times(2)).requestBufferBuilderBlocking();
verify(partitionWriter,
times(1)).writeBuffer(any(Buffer.class), anyInt());
// Verify that the written out buffer has only been
recycled once
// (by the partition writer).
- assertTrue("Buffer not recycled.", buffer.isRecycled());
- verify(buffer, times(1)).recycle();
+ assertEquals(1,
recycler.getRecycledMemorySegments().size());
+ assertEquals(memorySegment,
recycler.getRecycledMemorySegments().get(0));
--- End diff --
Of course if we used `TestPooledBufferProvider`, then we could only check
the number of recycled memory segments here but isn't that enough since we do
not use the recycler anywhere else?
---