@Test
  public void test06() throws IllegalPathException {
    IMemTable memTable0 = new PrimitiveMemTable(databasePath, dataRegionId);
    walNode1.onMemTableCreated(memTable0, logDirectory1 + "/" + "fake.tsfile");
    walNode1.log(
        memTable0.getMemTableId(),
        generateInsertRowNode(devicePath, System.currentTimeMillis(), 1));
    walNode1.rollWALFile();
    walNode1.log(
        memTable0.getMemTableId(),
        generateInsertRowNode(devicePath, System.currentTimeMillis(), 2));
    walNode1.rollWALFile();
    walNode1.log(
        memTable0.getMemTableId(),
        generateInsertRowNode(devicePath, System.currentTimeMillis(), 3));
    walNode1.rollWALFile();
    walNode1.log(
        memTable0.getMemTableId(),
        generateInsertRowNode(devicePath, System.currentTimeMillis(), 4));
    Awaitility.await().until(() -> walNode1.isAllWALEntriesConsumed());

    Map<Long, Set<Long>> memTableIdsOfWal = walNode1.getWALBuffer().getMemTableIdsOfWal();
    Assert.assertEquals(4, memTableIdsOfWal.size());
    Assert.assertEquals(4, WALFileUtils.listAllWALFiles(new File(logDirectory1)).length);

    walNode1.deleteOutdatedFiles();
    Map<Long, Set<Long>> memTableIdsOfWalAfter = walNode1.getWALBuffer().getMemTableIdsOfWal();
    Assert.assertEquals(4, memTableIdsOfWalAfter.size());
    Assert.assertEquals(4, WALFileUtils.listAllWALFiles(new File(logDirectory1)).length);
  }
Ensure that the flushed wal related to memtable cannot be deleted: <br>
1. _0-0-1.wal: memTable0 <br>
2. roll wal file <br>
3. _1-1-1.wal: memTable0 <br>
4. roll wal file <br>
5. _2-1-1.wal: memTable0 <br>
6. roll wal file <br>
7. _2-1-1.wal: memTable0 <br>
8. wait until all walEntry consumed <br>
9. delete outdated wal files
iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/wal/node/WalDeleteOutdatedNewTest.java