@Test
public void testOnlyOneChunkHeader() throws Exception {

  File file = new File(FILE_NAME);
  TsFileWriter writer = new TsFileWriter(file);
  writer.getIOWriter()
      .startFlushChunk(new MeasurementSchema("s1", TSDataType.FLOAT, TSEncoding.PLAIN),
          CompressionType.SNAPPY, TSDataType.FLOAT, TSEncoding.PLAIN, new FloatStatistics(), 100,
          10);
  writer.getIOWriter().close();
  RestorableTsFileIOWriter rWriter = new RestorableTsFileIOWriter(file);
  writer = new TsFileWriter(rWriter);
  writer.close();
  assertEquals(TsFileIOWriter.magicStringBytes.length + TsFileIOWriter.versionNumberBytes.length,
      rWriter.getTruncatedSize());
  assertTrue(file.delete());
}