pnowojski commented on a change in pull request #12364: URL: https://github.com/apache/flink/pull/12364#discussion_r431601126
########## File path: flink-runtime/src/test/java/org/apache/flink/runtime/state/filesystem/FsCheckpointStreamFactoryTest.java ########## @@ -57,6 +57,23 @@ public void createStateDirectories() throws IOException { // tests // ------------------------------------------------------------------------ + @Test + @SuppressWarnings("ConstantConditions") + public void testWriteFlushesIfAboveThreshold() throws IOException { + int fileSizeThreshold = 100; + final FsCheckpointStreamFactory factory = createFactory(FileSystem.getLocalFileSystem(), fileSizeThreshold, fileSizeThreshold); + final FsCheckpointStreamFactory.FsCheckpointStateOutputStream stream = factory.createCheckpointStateOutputStream(CheckpointedStateScope.EXCLUSIVE); + stream.write(new byte[fileSizeThreshold]); + File[] files = new File(exclusiveStateDir.toUri()).listFiles(); + assertEquals(1, files.length); + File file = files[0]; + assertEquals(fileSizeThreshold, file.length()); + for (int i = 0; i < fileSizeThreshold; i++) { + stream.write(127); // should buffer without flushing + } Review comment: add an additional ``` stream.write(new byte[10]); ``` call to also check the other write method for the flushing problem? ---------------------------------------------------------------- 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