##// END OF EJS Templates
run-tests: fix get port to try differing ports...
timeless -
r27602:67aa88e0 default
parent child Browse files
Show More
@@ -2015,11 +2015,11 b' class TestRunner(object):'
2015 def _getport(self, count):
2015 def _getport(self, count):
2016 port = self._ports.get(count) # do we have a cached entry?
2016 port = self._ports.get(count) # do we have a cached entry?
2017 if port is None:
2017 if port is None:
2018 port = self.options.port + self._portoffset
2019 portneeded = 3
2018 portneeded = 3
2020 # above 100 tries we just give up and let test reports failure
2019 # above 100 tries we just give up and let test reports failure
2021 for tries in xrange(100):
2020 for tries in xrange(100):
2022 allfree = True
2021 allfree = True
2022 port = self.options.port + self._portoffset
2023 for idx in xrange(portneeded):
2023 for idx in xrange(portneeded):
2024 if not checkportisavailable(port + idx):
2024 if not checkportisavailable(port + idx):
2025 allfree = False
2025 allfree = False
@@ -223,6 +223,20 b' Verify that when a process fails to star'
223 [1]
223 [1]
224 $ rm test-serve-fail.t
224 $ rm test-serve-fail.t
225
225
226 Verify that we can try other ports
227 ===================================
228 $ hg init inuse
229 $ hg serve -R inuse -p $HGPORT -d --pid-file=blocks.pid
230 $ cat blocks.pid >> $DAEMON_PIDS
231 $ cat > test-serve-inuse.t <<EOF
232 > $ hg serve -R `pwd`/inuse -p \$HGPORT -d --pid-file=hg.pid
233 > $ cat hg.pid >> \$DAEMON_PIDS
234 > EOF
235 $ rt test-serve-inuse.t
236 .
237 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
238 $ rm test-serve-inuse.t
239
226 Running In Debug Mode
240 Running In Debug Mode
227 ======================
241 ======================
228
242
General Comments 0
You need to be logged in to leave comments. Login now