use of org.apache.flink.runtime.io.network.buffer.BufferBuilderTestUtils.createFilledFinishedBufferConsumer in project flink by apache.
the class SubpartitionTestBase method testRecycleBufferAndConsumerOnFailure.
@Test
public void testRecycleBufferAndConsumerOnFailure() throws Exception {
final ResultSubpartition subpartition = createFailingWritesSubpartition();
try {
final BufferConsumer consumer = BufferBuilderTestUtils.createFilledFinishedBufferConsumer(100);
try {
subpartition.add(consumer);
subpartition.flush();
fail("should fail with an exception");
} catch (Exception ignored) {
// expected
}
assertTrue(consumer.isRecycled());
} finally {
subpartition.release();
}
}
Aggregations