From 08aada3ca92423d7dcf4529ebcded71185ab1970 Mon Sep 17 00:00:00 2001 From: Noah Levitt Date: Tue, 3 Apr 2018 11:15:48 -0700 Subject: [PATCH] this is some logging meant to debug the mysterious MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test failure we've been seeing which so far has made the problem go away(!?!?) 😀😞 ¯\_(ツ)_/¯ 😞😀 ¯\_(ツ)_/¯ 😀😞 ¯\_(ツ)_/¯ 😞😀 here is the last time the failure happened: https://travis-ci.org/internetarchive/warcprox/jobs/361409280 --- tests/test_warcprox.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/test_warcprox.py b/tests/test_warcprox.py index 9d6db7d..26e1017 100755 --- a/tests/test_warcprox.py +++ b/tests/test_warcprox.py @@ -315,9 +315,17 @@ def cert(request): finally: f.close() +class UhhhServer(http_server.HTTPServer): + def get_request(self): + try: + return self.socket.accept() + except: + logging.error('socket.accept() raised exception', exc_info=True) + raise + @pytest.fixture(scope="module") def http_daemon(request): - http_daemon = http_server.HTTPServer( + http_daemon = UhhhServer( ('localhost', 0), RequestHandlerClass=_TestHttpRequestHandler) logging.info('starting http://{}:{}'.format(http_daemon.server_address[0], http_daemon.server_address[1])) http_daemon_thread = threading.Thread(name='HttpDaemonThread',