private void assertArchiveFiles(FileSystem fs, List<String> storeFiles, long timeout)
    throws IOException {
    long end = EnvironmentEdgeManager.currentTime() + timeout;
    Path archiveDir = HFileArchiveUtil.getArchivePath(UTIL.getConfiguration());
    List<String> archivedFiles = new ArrayList<>();

    // We have to ensure that the DeleteTableHandler is finished. HBaseAdmin.deleteXXX()
    // can return before all files
    // are archived. We should fix HBASE-5487 and fix synchronous operations from admin.
    while (EnvironmentEdgeManager.currentTime() < end) {
      archivedFiles = getAllFileNames(fs, archiveDir);
      if (archivedFiles.size() >= storeFiles.size()) {
        break;
      }
    }

    Collections.sort(storeFiles);
    Collections.sort(archivedFiles);

    LOG.debug("Store files:");
    for (int i = 0; i < storeFiles.size(); i++) {
      LOG.debug(i + " - " + storeFiles.get(i));
    }
    LOG.debug("Archive files:");
    for (int i = 0; i < archivedFiles.size(); i++) {
      LOG.debug(i + " - " + archivedFiles.get(i));
    }

    assertTrue("Archived files are missing some of the store files!",
      archivedFiles.containsAll(storeFiles));
  }
Test that the region directory is removed when we archive a region without store files, but
still has hidden files.
@throws IOException throws an IOException if there's problem creating a table or if there's an
                    issue with accessing FileSystem.
hbase-server/src/test/java/org/apache/hadoop/hbase/backup/TestHFileArchiving.java