Mercurial > hg
changeset 27602:67aa88e00fc7
run-tests: fix get port to try differing ports
The code was moving its offset each time through the loop,
but because it failed to update port, the port was not
going to be available...
author | timeless <timeless@mozdev.org> |
---|---|
date | Tue, 29 Dec 2015 04:30:38 +0000 |
parents | 1ad9da968a2e |
children | 8a87627d263a |
files | tests/run-tests.py tests/test-run-tests.t |
diffstat | 2 files changed, 15 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/run-tests.py Thu Dec 31 13:19:20 2015 -0500 +++ b/tests/run-tests.py Tue Dec 29 04:30:38 2015 +0000 @@ -2015,11 +2015,11 @@ def _getport(self, count): port = self._ports.get(count) # do we have a cached entry? if port is None: - port = self.options.port + self._portoffset portneeded = 3 # above 100 tries we just give up and let test reports failure for tries in xrange(100): allfree = True + port = self.options.port + self._portoffset for idx in xrange(portneeded): if not checkportisavailable(port + idx): allfree = False
--- a/tests/test-run-tests.t Thu Dec 31 13:19:20 2015 -0500 +++ b/tests/test-run-tests.t Tue Dec 29 04:30:38 2015 +0000 @@ -223,6 +223,20 @@ [1] $ rm test-serve-fail.t +Verify that we can try other ports +=================================== + $ hg init inuse + $ hg serve -R inuse -p $HGPORT -d --pid-file=blocks.pid + $ cat blocks.pid >> $DAEMON_PIDS + $ cat > test-serve-inuse.t <<EOF + > $ hg serve -R `pwd`/inuse -p \$HGPORT -d --pid-file=hg.pid + > $ cat hg.pid >> \$DAEMON_PIDS + > EOF + $ rt test-serve-inuse.t + . + # Ran 1 tests, 0 skipped, 0 warned, 0 failed. + $ rm test-serve-inuse.t + Running In Debug Mode ======================