private static void setupTestEnv(boolean sslEnabled) {
    // With ZooKeeper 3.5 we need to whitelist the 4 letter commands we use
    System.setProperty("zookeeper.4lw.commands.whitelist", "*");

    // during the tests we run with 100K prealloc in the logs.
    // on windows systems prealloc of 64M was seen to take ~15seconds
    // resulting in test failure (client timeout on first session).
    // set env and directly in order to handle static init/gc issues
    System.setProperty("zookeeper.preAllocSize", "100");
    if (sslEnabled) {
      System.setProperty("zookeeper.authProvider.x509", "org.apache.zookeeper.server.auth.X509AuthenticationProvider");
    }
    FileTxnLog.setPreallocSize(100 * 1024);
  }
Selects a ZK client port.

@param seedPort the seed port to start with; -1 means first time.
@Returns a valid and unused client port
ql/src/test/org/apache/hive/testutils/MiniZooKeeperCluster.java