diff --git a/flume-ng-channels/flume-file-channel/src/test/java/org/apache/flume/channel/file/TestLog.java b/flume-ng-channels/flume-file-channel/src/test/java/org/apache/flume/channel/file/TestLog.java index e85274da56..6a787b65c6 100644 --- a/flume-ng-channels/flume-file-channel/src/test/java/org/apache/flume/channel/file/TestLog.java +++ b/flume-ng-channels/flume-file-channel/src/test/java/org/apache/flume/channel/file/TestLog.java @@ -29,6 +29,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; @@ -228,12 +229,14 @@ public void doTestMinimumRequiredSpaceTooSmallForPut() throws IOException, .build(); log.replay(); File filler = new File(checkpointDir, "filler"); - byte[] buffer = new byte[64 * 1024]; FileOutputStream out = new FileOutputStream(filler); + BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(out); while (checkpointDir.getUsableSpace() > minimumRequiredSpace) { - out.write(buffer); + String data = "this is dynamic data byte"; + byte[] dataBytes = data.getBytes(); + bufferedOutputStream.write(dataBytes); } - out.close(); + bufferedOutputStream.flush(); try { FlumeEvent eventIn = TestUtils.newPersistableEvent(); long transactionID = ++this.transactionID;