Mercurial > hg
comparison tests/run-tests.py @ 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 | 54bc0e884385 |
children | a1eff44c432b |
comparison
equal
deleted
inserted
replaced
27601:1ad9da968a2e | 27602:67aa88e00fc7 |
---|---|
2013 return 80 | 2013 return 80 |
2014 | 2014 |
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 |
2026 break | 2026 break |
2027 self._portoffset += portneeded | 2027 self._portoffset += portneeded |