private boolean checkPortAvailable() {
    for (Peer peer : this.peers) {
      try (ServerSocket ignored = new ServerSocket(peer.getEndpoint().port)) {
        logger.info("check port {} success for node {}", peer.getEndpoint().port, peer.getNodeId());
      } catch (IOException e) {
        logger.error("check port {} failed for node {}", peer.getEndpoint().port, peer.getNodeId());
        return false;
      }
    }
    return true;
  }
First, suspend one node to test that the request replication between the two alive nodes is ok,
then restart all nodes to lose state in the queue, and test using WAL replication to make all
nodes finally consistent.
iotdb-core/consensus/src/test/java/org/apache/iotdb/consensus/iot/ReplicateTest.java