Re: [PATCH STABLE] test-static-http: flush access log per request

2017-10-30 Thread Augie Fackler
On Mon, Oct 30, 2017 at 11:18:54PM +0900, Yuya Nishihara wrote:
> On Sun, 29 Oct 2017 13:57:47 -0400, Matt Harbison wrote:
> > On Sun, 29 Oct 2017 05:05:17 -0400, Yuya Nishihara  wrote:
> > > # 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

queued, thanks
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH STABLE] test-static-http: flush access log per request

2017-10-30 Thread Yuya Nishihara
On Sun, 29 Oct 2017 13:57:47 -0400, Matt Harbison wrote:
> On Sun, 29 Oct 2017 05:05:17 -0400, Yuya Nishihara  wrote:
> > # 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.
> 
> Ugh, I should have known, since I had to fix this in multiple other places  
> before.  Long term, is there any reason that we can't use setvbuf() and  
> _IONBF, since there is no line buffering on Windows?
> 
> https://msdn.microsoft.com/en-us/library/86cebhfs.aspx

I doubt setvbuf() would be an easy workaround since stdio layer is likely to
have weird behavior. And it's completely written in Python 3 to not use the
platform fread/fwrite() API.

> This + the removal of the platform path separators fixes the test for me,
> thanks.

Thanks for testing them.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH STABLE] test-static-http: flush access log per request

2017-10-29 Thread Matt Harbison

On Sun, 29 Oct 2017 05:05:17 -0400, Yuya Nishihara  wrote:


# 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.


Ugh, I should have known, since I had to fix this in multiple other places  
before.  Long term, is there any reason that we can't use setvbuf() and  
_IONBF, since there is no line buffering on Windows?


https://msdn.microsoft.com/en-us/library/86cebhfs.aspx

This + the removal of the platform path separators fixes the test for me,  
thanks.

___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH STABLE] test-static-http: flush access log per request

2017-10-29 Thread Yuya Nishihara
# 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()
 
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel