Merge pull request #7197 from kpayson64/port_server_fix

Change port_server.py to use port 32766
pull/7239/head
Nicolas Noble 9 years ago committed by GitHub
commit 014b070a94
  1. 4
      tools/run_tests/port_server.py
  2. 18
      tools/run_tests/run_tests.py

@ -42,7 +42,7 @@ import time
# increment this number whenever making a change to ensure that # increment this number whenever making a change to ensure that
# the changes are picked up by running CI servers # the changes are picked up by running CI servers
# note that all changes must be backwards compatible # note that all changes must be backwards compatible
_MY_VERSION = 7 _MY_VERSION = 8
if len(sys.argv) == 2 and sys.argv[1] == 'dump_version': if len(sys.argv) == 2 and sys.argv[1] == 'dump_version':
@ -70,7 +70,7 @@ in_use = {}
def refill_pool(max_timeout, req): def refill_pool(max_timeout, req):
"""Scan for ports not marked for being in use""" """Scan for ports not marked for being in use"""
for i in range(1025, 32767): for i in range(1025, 32766):
if len(pool) > 100: break if len(pool) > 100: break
if i in in_use: if i in in_use:
age = time.time() - in_use[i] age = time.time() - in_use[i]

@ -1050,7 +1050,23 @@ runs_per_test = args.runs_per_test
forever = args.forever forever = args.forever
def _shut_down_legacy_server(legacy_server_port):
try:
version = int(urllib2.urlopen(
'http://localhost:%d/version_number' % legacy_server_port,
timeout=10).read())
except:
pass
else:
urllib2.urlopen(
'http://localhost:%d/quitquitquit' % legacy_server_port).read()
def _start_port_server(port_server_port): def _start_port_server(port_server_port):
# Temporary patch to switch the port_server port
# see https://github.com/grpc/grpc/issues/7145
_shut_down_legacy_server(32767)
# check if a compatible port server is running # check if a compatible port server is running
# if incompatible (version mismatch) ==> start a new one # if incompatible (version mismatch) ==> start a new one
# if not running ==> start a new one # if not running ==> start a new one
@ -1186,7 +1202,7 @@ def _build_and_run(
# start antagonists # start antagonists
antagonists = [subprocess.Popen(['tools/run_tests/antagonist.py']) antagonists = [subprocess.Popen(['tools/run_tests/antagonist.py'])
for _ in range(0, args.antagonists)] for _ in range(0, args.antagonists)]
port_server_port = 32767 port_server_port = 32766
_start_port_server(port_server_port) _start_port_server(port_server_port)
resultset = None resultset = None
num_test_failures = 0 num_test_failures = 0

Loading…
Cancel
Save