protected NodeConnection getWriteConnection(
      Constant.Version version, String username, String password, String sqlDialect)
      throws SQLException {
    DataNodeWrapper dataNode;

    if (System.getProperty("RandomSelectWriteNode", "true").equalsIgnoreCase("true")) {
      // Randomly choose a node for handling write requests
      dataNode = this.dataNodeWrapperList.get(rand.nextInt(this.dataNodeWrapperList.size()));
    } else {
      dataNode = this.dataNodeWrapperList.get(0);
    }

    return getWriteConnectionFromDataNodeList(
        this.dataNodeWrapperList, version, username, password, sqlDialect);
  }
check whether all nodes' status match the provided predicate with RPC. after retryCount times,
if the status of all nodes still not match the predicate, throw AssertionError.

@param statusCheck the predicate to test the status of nodes
integration-test/src/main/java/org/apache/iotdb/it/env/cluster/env/AbstractEnv.java