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

@@ -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()