View Revisions: Issue #5209

Summary 0005209: test cases should not use fixed port numbers
Revision 2017-12-10 14:49 by Florian Dold
Description For example the merchant lib test uses port 8081, which clashes with some buildbot port.

We can also run into cases where two tests are executed simultaneously, with some bad luck one of them will fail.

We can find free ports e.g. with this method: https://www.dnorth.net/2012/03/17/the-port-0-trick/

The idea is to:
1) select a port that is currently free
2) start the exchange (or whatever component we need to run)
3) if it failed (because of a race on the port), try again with another port for some small number of tries

And on systems where it's not supported, we fall back to a fixed port number.
Revision 2017-12-10 14:47 by Florian Dold
Description For example the merchant lib test uses port 8081, which clashes with some buildbot port.

We can find free ports e.g. with this method: https://www.dnorth.net/2012/03/17/the-port-0-trick/

The idea is to:
1) select a port that is currently free
2) start the exchange (or whatever component we need to run)
3) if it failed (because of a race on the port), try again with another port for some small number of tries

And on systems where it's not supported, we fall back to a fixed port number.