gerrit/gerrit-pgm
David Ostrovsky c7095c8450 Acceptance-tests: Fix 'Address already in use' bug
This change fixes ephemeral port assignment for HTTP and SSH daemons.

Current implementation is broken: it assigns a random port in GerritServer,
closes the socket and effectively freeing it for the kernel to recycle to
another thread, and store that port in gerrit.config file for reuse. Some
time later in HTTP and SSH daemons the port number get read from the config
file and the ports are bound.  The problem is, that during this "think time"
another test got the same port assigned and bind attempt is failing with:

  Caused by: java.net.BindException: Address already in use

To rectify it, set port to 0 in gerrit.config for both HTTP and SSH daemons
and let the daemons to do the ephemeral port assignments.  In SSH and HTTP
daemons this special case is recognized and the assigned ports are written
back to gerrit.config to pass to the test harness side.

Change-Id: Ib4971b200d6dc86268674398fe590137ae35b6f3
2014-04-24 08:30:15 +02:00
..
src Acceptance-tests: Fix 'Address already in use' bug 2014-04-24 08:30:15 +02:00
BUCK Install all packaged plugins automatically on auto site init 2014-02-21 13:24:09 +01:00