From patchwork Sun Oct 29 09:05:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [STABLE] test-static-http: flush access log per request From: Yuya Nishihara X-Patchwork-Id: 25307 Message-Id: To: mercurial-devel@mercurial-scm.org Cc: mharbison72@gmail.com Date: Sun, 29 Oct 2017 18:05:17 +0900 # HG changeset patch # User Yuya Nishihara # Date 1509267232 -32400 # Sun Oct 29 17:53:52 2017 +0900 # Branch stable # Node ID ce935a5de7737d4706d3f5d50184665f955017e3 # Parent ee3492423f7c8b1a350b2596c247e1b97759d2d7 test-static-http: flush access log per request It appears that stderr is fully buffered on Windows. # no-check-commit because of log_message() function diff --git a/tests/dumbhttp.py b/tests/dumbhttp.py --- a/tests/dumbhttp.py +++ b/tests/dumbhttp.py @@ -26,12 +26,16 @@ if os.environ.get('HGIPV6', '0') == '1': else: simplehttpserver = httpserver.httpserver +class _httprequesthandler(httpserver.simplehttprequesthandler): + def log_message(self, format, *args): + httpserver.simplehttprequesthandler.log_message(self, format, *args) + sys.stderr.flush() + class simplehttpservice(object): def __init__(self, host, port): self.address = (host, port) def init(self): - self.httpd = simplehttpserver( - self.address, httpserver.simplehttprequesthandler) + self.httpd = simplehttpserver(self.address, _httprequesthandler) def run(self): self.httpd.serve_forever()