incubator-blur-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Garrett Barton (JIRA)" <>
Subject [jira] [Commented] (BLUR-222) Random ports for unit tests
Date Fri, 13 Sep 2013 12:42:54 GMT


Garrett Barton commented on BLUR-222:

Not sure if this works totally for you, I wrote an embedded zk class that runs in its own
thread a while ago and it handles coming up on a random port. You can then ask for the port
which will block until its set (meaning zk is alive).

Check it out here:

The important bits are this:
server = new ZooKeeperServer(logDir, logDir, tickTime);
standaloneServerFactory = ServerCnxnFactory.createFactory(0, numConnections);
int p = standaloneServerFactory.getLocalPort();
> Random ports for unit tests
> ---------------------------
>                 Key: BLUR-222
>                 URL:
>             Project: Apache Blur
>          Issue Type: Bug
>          Components: Blur
>    Affects Versions: 0.2.0, 0.3.0
>            Reporter: Aaron McCurry
> There are a couple of unit tests that have hard coded ports, this is an issue on CI servers
that are multi-tenant.  The units should be random chosen when the tests run.
> The big 2 are ZooKeeperStatusClusterTest and BlurMiniCluster.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message