# HG changeset patch # User timeless # Date 1451363438 0 # Node ID 67aa88e00fc73f50b6034bf7bd03f4efaafacbed # Parent 1ad9da968a2e8a244478fd98730ed4791d6c835d 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... diff -r 1ad9da968a2e -r 67aa88e00fc7 tests/run-tests.py --- 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 diff -r 1ad9da968a2e -r 67aa88e00fc7 tests/test-run-tests.t --- 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 < $ 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 ======================