void writeManyParallel(ExecutorService executor, int serverIndex, int count) {
      final CountDownLatch waitGroup = new CountDownLatch(count);
      for (int i = 0; i < count; i++) {
        CompletableFuture.runAsync(() -> writeOnce(serverIndex), executor)
            .thenRun(waitGroup::countDown);
      }

      try {
        // wait at most 120s for write to complete, otherwise fail the test
        Assert.assertTrue(waitGroup.await(120, TimeUnit.SECONDS));
      } catch (InterruptedException e) {
        logger.warn("test being interrupted: ", e);
        Thread.currentThread().interrupt();
      }
    }
A Mini Raft CLuster Wrapper for Test Env.
iotdb-core/consensus/src/test/java/org/apache/iotdb/consensus/ratis/TestUtils.java