diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/run_tests/README.md | 2 | ||||
-rwxr-xr-x | tools/run_tests/artifacts/build_artifact_node.sh | 2 | ||||
-rwxr-xr-x | tools/run_tests/helper_scripts/build_node.sh | 4 | ||||
-rwxr-xr-x | tools/run_tests/performance/build_performance.sh | 3 | ||||
-rwxr-xr-x | tools/run_tests/python_utils/port_server.py | 50 | ||||
-rwxr-xr-x | tools/run_tests/run_tests.py | 8 | ||||
-rwxr-xr-x | tools/run_tests/run_tests_matrix.py | 11 |
7 files changed, 42 insertions, 38 deletions
diff --git a/tools/run_tests/README.md b/tools/run_tests/README.md index 05d33fd6b1..60f20747cd 100644 --- a/tools/run_tests/README.md +++ b/tools/run_tests/README.md @@ -33,7 +33,7 @@ the script also supports orchestrating test runs with client and server running to BigQuery. ###### Example -`tools/run_tests/run_peformance_tests.py -l c++ node` +`tools/run_tests/run_performance_tests.py -l c++ node` ###### Useful options - `--regex` use regex to select particular scenarios to run. diff --git a/tools/run_tests/artifacts/build_artifact_node.sh b/tools/run_tests/artifacts/build_artifact_node.sh index 2da2ac5f91..7a747551e8 100755 --- a/tools/run_tests/artifacts/build_artifact_node.sh +++ b/tools/run_tests/artifacts/build_artifact_node.sh @@ -48,7 +48,7 @@ electron_versions=( 1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 ) for version in ${node_versions[@]} do - ./node_modules/.bin/node-pre-gyp configure rebuild package testpackage --target=$version --target_arch=$NODE_TARGET_ARCH + ./node_modules/.bin/node-pre-gyp configure rebuild package testpackage --target=$version --target_arch=$NODE_TARGET_ARCH --grpc_alpine=true cp -r build/stage/* artifacts/ done diff --git a/tools/run_tests/helper_scripts/build_node.sh b/tools/run_tests/helper_scripts/build_node.sh index 2c4cf02d8f..07ecf98396 100755 --- a/tools/run_tests/helper_scripts/build_node.sh +++ b/tools/run_tests/helper_scripts/build_node.sh @@ -46,6 +46,4 @@ case "$CONFIG" in *) config_flag='--release' ;; esac -uv_flag=$2 - -npm install --unsafe-perm --build-from-source $uv_flag $config_flag +npm install --unsafe-perm --build-from-source $config_flag diff --git a/tools/run_tests/performance/build_performance.sh b/tools/run_tests/performance/build_performance.sh index 3f7c9fed96..5f8749dda2 100755 --- a/tools/run_tests/performance/build_performance.sh +++ b/tools/run_tests/performance/build_performance.sh @@ -61,9 +61,6 @@ do "csharp") python tools/run_tests/run_tests.py -l $language -c $CONFIG --build_only -j 8 --compiler coreclr ;; - "node") - python tools/run_tests/run_tests.py -l $language -c $CONFIG --build_only -j 8 --iomgr_platform=uv - ;; *) python tools/run_tests/run_tests.py -l $language -c $CONFIG --build_only -j 8 ;; diff --git a/tools/run_tests/python_utils/port_server.py b/tools/run_tests/python_utils/port_server.py index e96ee0b08c..079ed70fbf 100755 --- a/tools/run_tests/python_utils/port_server.py +++ b/tools/run_tests/python_utils/port_server.py @@ -39,6 +39,7 @@ import os import socket import sys import time +import random from SocketServer import ThreadingMixIn import threading @@ -46,7 +47,7 @@ import threading # increment this number whenever making a change to ensure that # the changes are picked up by running CI servers # note that all changes must be backwards compatible -_MY_VERSION = 14 +_MY_VERSION = 19 if len(sys.argv) == 2 and sys.argv[1] == 'dump_version': @@ -72,10 +73,33 @@ pool = [] in_use = {} mu = threading.Lock() +def can_connect(port): + s = socket.socket() + try: + s.connect(('localhost', port)) + return True + except socket.error, e: + return False + finally: + s.close() + +def can_bind(port, proto): + s = socket.socket(proto, socket.SOCK_STREAM) + s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + try: + s.bind(('localhost', port)) + return True + except socket.error, e: + return False + finally: + s.close() + def refill_pool(max_timeout, req): """Scan for ports not marked for being in use""" - for i in range(1025, 32766): + chk = list(range(1025, 32766)) + random.shuffle(chk) + for i in chk: if len(pool) > 100: break if i in in_use: age = time.time() - in_use[i] @@ -83,16 +107,9 @@ def refill_pool(max_timeout, req): continue req.log_message("kill old request %d" % i) del in_use[i] - s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) - try: - s.bind(('localhost', i)) + if can_bind(i, socket.AF_INET) and can_bind(i, socket.AF_INET6) and not can_connect(i): req.log_message("found available port %d" % i) pool.append(i) - except: - pass # we really don't care about failures - finally: - s.close() def allocate_port(req): @@ -128,6 +145,7 @@ class Handler(BaseHTTPRequestHandler): def do_GET(self): global keep_running + global mu if self.path == '/get': # allocate a new port, it will stay bound for ten minutes and until # it's unused @@ -142,12 +160,15 @@ class Handler(BaseHTTPRequestHandler): self.send_header('Content-Type', 'text/plain') self.end_headers() p = int(self.path[6:]) + mu.acquire() if p in in_use: del in_use[p] pool.append(p) - self.log_message('drop known port %d' % p) + k = 'known' else: - self.log_message('drop unknown port %d' % p) + k = 'unknown' + mu.release() + self.log_message('drop %s port %d' % (k, p)) elif self.path == '/version_number': # fetch a version string and the current process pid self.send_response(200) @@ -161,8 +182,11 @@ class Handler(BaseHTTPRequestHandler): self.send_response(200) self.send_header('Content-Type', 'text/plain') self.end_headers() + mu.acquire() now = time.time() - self.wfile.write(yaml.dump({'pool': pool, 'in_use': dict((k, now - v) for k, v in in_use.items())})) + out = yaml.dump({'pool': pool, 'in_use': dict((k, now - v) for k, v in in_use.items())}) + mu.release() + self.wfile.write(out) elif self.path == '/quitquitquit': self.send_response(200) self.end_headers() diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 4da2ba4c3b..62e92c3d1d 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -430,10 +430,6 @@ class NodeLanguage(object): _check_compiler(self.args.compiler, ['default', 'node0.12', 'node4', 'node5', 'node6', 'node7', 'electron1.3', 'electron1.6']) - if args.iomgr_platform == "uv": - self.use_uv = True - else: - self.use_uv = False if self.args.compiler == 'default': self.runtime = 'node' self.node_version = '7' @@ -481,7 +477,6 @@ class NodeLanguage(object): else: config_flag = '--release' return [['tools\\run_tests\\helper_scripts\\build_node.bat', - '--grpc_uv={}'.format('true' if self.use_uv else 'false'), config_flag]] else: build_script = 'build_node' @@ -490,8 +485,7 @@ class NodeLanguage(object): # building for electron requires a patch version self.node_version += '.0' return [['tools/run_tests/helper_scripts/{}.sh'.format(build_script), - self.node_version, - '--grpc_uv={}'.format('true' if self.use_uv else 'false')]] + self.node_version]] def post_tests_steps(self): return [] diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py index 70340cd747..474b56b5de 100755 --- a/tools/run_tests/run_tests_matrix.py +++ b/tools/run_tests/run_tests_matrix.py @@ -169,7 +169,7 @@ def _create_test_jobs(extra_args=[], inner_jobs=_DEFAULT_INNER_JOBS): # sanitizers test_jobs += _generate_jobs(languages=['c'], - configs=['msan', 'asan', 'tsan'], + configs=['msan', 'asan', 'tsan', 'ubsan'], platforms=['linux'], labels=['sanitizers'], extra_args=extra_args, @@ -289,15 +289,6 @@ def _create_portability_test_jobs(extra_args=[], inner_jobs=_DEFAULT_INNER_JOBS) platforms=['linux'], arch='default', compiler='electron1.6', - iomgr_platform='uv', - labels=['portability'], - extra_args=extra_args, - inner_jobs=inner_jobs) - - test_jobs += _generate_jobs(languages=['node'], - configs=['dbg'], - platforms=['linux'], - iomgr_platform='uv', labels=['portability'], extra_args=extra_args, inner_jobs=inner_jobs) |