tillrohrmann commented on a change in pull request #14904: URL: https://github.com/apache/flink/pull/14904#discussion_r576070731
########## File path: flink-core/src/test/java/org/apache/flink/core/memory/HybridOffHeapUnsafeMemorySegmentTest.java ########## @@ -38,4 +39,10 @@ MemorySegment createSegment(int size) { MemorySegment createSegment(int size, Object owner) { return MemorySegmentFactory.allocateOffHeapUnsafeMemory(size, owner, () -> {}); } + + @Override + @Test(expected = UnsupportedOperationException.class) + public void testByteBufferWrapping() { + createSegment(10).wrap(1, 2); + } Review comment: Maybe add a test which ensures that we call the cleaner in case of `free`. ---------------------------------------------------------------- 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: us...@infra.apache.org