make socks.py and http.py shut themselves down after a timeout of inactivity (maybe that will fix the problem of them lingering, stalling tests). fix some issues in run_regression_tests.py

This commit is contained in:
Arvid Norberg 2013-10-03 05:44:38 +00:00
parent fdaffc5f1a
commit d1f41a72f4
4 changed files with 10 additions and 3 deletions

View File

@ -192,6 +192,7 @@ def start_server(host='localhost', port=8080, IPv6=False, timeout=60,
else:
soc_type=socket.AF_INET
soc = socket.socket(soc_type)
soc.settimeout(50)
print "Serving on %s:%d."%(host, port)#debug
soc.bind((host, port))
soc.listen(0)

View File

@ -13,6 +13,10 @@ import sys
class MyTCPServer(ThreadingTCPServer):
allow_reuse_address = True
def handle_timeout(self):
raise Exception('timeout')
CLOSE = object()
logging.basicConfig(stream=sys.stderr, level=logging.INFO)
@ -252,4 +256,6 @@ if __name__ == '__main__':
info('Listening on port %d...' % listen_port)
server = MyTCPServer(('localhost', listen_port), SocksHandler)
server.serve_forever()
server.timeout = 50
while True:
server.handle_request()

View File

@ -88,11 +88,11 @@ def loop():
skip = '-s' in sys.argv
rev_file = os.path.join(os.getcwd(), '.rev')
if skip:
sys.argv.remove('-s')
last_rev = run_tests.svn_info()[0] - 1
else:
rev_file = os.path.join(os.getcwd(), '.rev')
print 'restoring last state from "%s"' % rev_file
try:

View File

@ -100,7 +100,6 @@ def run_tests(toolset, tests, features, options, test_dir, time_limit, increment
# p.wait()
for t in tests:
if t != '': cmdline.append(t)
if t == '':
t = os.path.split(os.getcwd())[1]
# we can't pass in a launcher when just building, that only
@ -109,6 +108,7 @@ def run_tests(toolset, tests, features, options, test_dir, time_limit, increment
options = options[:]
options.remove('launcher=valgrind')
cmdline = ['bjam', '--out-xml=%s' % xml_file, '-l%d' % time_limit, '--abbreviate-paths', toolset] + options + feature_list
if t != '': cmdline.append(t)
# print ' '.join(cmdline)