aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/run_tests/python_utils
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2017-12-07 10:47:51 -0800
committerGravatar Muxi Yan <mxyan@google.com>2017-12-07 14:16:39 -0800
commitcd62e7d04cd13cbe4a2670fcb64ba57594c787b3 (patch)
tree9d358bbbd6be578f09bc519d4e99e82ab49463ab /tools/run_tests/python_utils
parent95e23594b026eca21151f31b039bd2a51ea67109 (diff)
Exclude cronet restricted ports from port server pool
Diffstat (limited to 'tools/run_tests/python_utils')
-rwxr-xr-xtools/run_tests/python_utils/port_server.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/run_tests/python_utils/port_server.py b/tools/run_tests/python_utils/port_server.py
index 4fb5ca0e94..e8ac71af8d 100755
--- a/tools/run_tests/python_utils/port_server.py
+++ b/tools/run_tests/python_utils/port_server.py
@@ -57,6 +57,17 @@ pool = []
in_use = {}
mu = threading.Lock()
+# Cronet restricts the following ports to be used (see
+# https://cs.chromium.org/chromium/src/net/base/port_util.cc). When one of these
+# ports is used in a Cronet test, the test would fail (see issue #12149). These
+# ports must be excluded from pool.
+cronet_restricted_ports = [1, 7, 9, 11, 13, 15, 17, 19, 20, 21, 22, 23, 25, 37,
+ 42, 43, 53, 77, 79, 87, 95, 101, 102, 103, 104, 109,
+ 110, 111, 113, 115, 117, 119, 123, 135, 139, 143,
+ 179, 389, 465, 512, 513, 514, 515, 526, 530, 531,
+ 532, 540, 556, 563, 587, 601, 636, 993, 995, 2049,
+ 3659, 4045, 6000, 6665, 6666, 6667, 6668, 6669, 6697]
+
def can_connect(port):
# this test is only really useful on unices where SO_REUSE_PORT is available
# so on Windows, where this test is expensive, skip it
@@ -84,7 +95,7 @@ def can_bind(port, proto):
def refill_pool(max_timeout, req):
"""Scan for ports not marked for being in use"""
- chk = list(range(1025, 32766))
+ chk = [port for port in list(range(1025, 32766)) if port not in cronet_restricted_ports]
random.shuffle(chk)
for i in chk:
if len(pool) > 100: break