[PATCH 3 of 3 v2] run-tests: validate cached port in _getport

timeless timeless at mozdev.org
Mon Dec 28 23:40:00 CST 2015


# HG changeset patch
# User timeless <timeless at mozdev.org>
# Date 1451364276 0
#      Tue Dec 29 04:44:36 2015 +0000
# Node ID ecd36680cdf2dd63864505f60ee14ed3ef84e864
# Parent  a12404484af03ddddbd326af08ca1217b77ebc13
run-tests: validate cached port in _getport

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -2012,9 +2012,9 @@
         return True
 
     def _getport(self, count):
+        portneeded = 3
         port = self._ports.get(count) # do we have a cached entry?
-        if port is None:
-            portneeded = 3
+        if port is None or not self._checkportrange(port, portneeded):
             # above 100 tries we just give up and let test reports failure
             for tries in xrange(100):
                 port = self.options.port + self._portoffset


More information about the Mercurial-devel mailing list