private static void checkRegionFileClear(int dataNode) {
    File originalRegionDir = new File(buildRegionDirPath(dataNode));
    Assert.assertTrue(originalRegionDir.isDirectory());
    try {
      Assert.assertEquals(0, Objects.requireNonNull(originalRegionDir.listFiles()).length);
    } catch (AssertionError e) {
      LOGGER.error(
          "Original DataNode {} region file not clear, these files is still remain: {}",
          dataNode,
          Arrays.toString(originalRegionDir.listFiles()));
      throw e;
    }
    LOGGER.info("Original DataNode {} region file clear", dataNode);
  }
Check whether the original DataNode's region file has been deleted.
integration-test/src/test/java/org/apache/iotdb/confignode/it/regionmigration/IoTDBRegionOperationReliabilityITFramework.java