Patchwork [2,of,2] test-http-proxy: redirect proxy stdout to /dev/null

login
register
mail settings
Submitter Matt Harbison
Date June 20, 2017, 1:59 a.m.
Message ID <9f8fff60da6e472f3530.1497923941@Envy>
Download mbox | patch
Permalink /patch/21517/
State Accepted
Headers show

Comments

Matt Harbison - June 20, 2017, 1:59 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1497923634 14400
#      Mon Jun 19 21:53:54 2017 -0400
# Node ID 9f8fff60da6e472f35308fa3a439930a65aff419
# Parent  67a2a0b9a3bf90ecd4e876cdd5f4f94b570314ee
test-http-proxy: redirect proxy stdout to /dev/null

This output hasn't been getting flushed, but would alter the log if it ever grew
large enough.  See 23b07333a8b2.

Patch

diff --git a/tests/test-http-proxy.t b/tests/test-http-proxy.t
--- a/tests/test-http-proxy.t
+++ b/tests/test-http-proxy.t
@@ -8,7 +8,7 @@ 
   $ hg serve --config server.uncompressed=True -p $HGPORT -d --pid-file=hg.pid
   $ cat hg.pid >> $DAEMON_PIDS
   $ cd ..
-  $ tinyproxy.py $HGPORT1 localhost >proxy.log 2>&1 </dev/null &
+  $ tinyproxy.py $HGPORT1 localhost 2>proxy.log >/dev/null </dev/null &
   $ while [ ! -f proxy.pid ]; do sleep 0; done
   $ cat proxy.pid >> $DAEMON_PIDS
 
diff --git a/tests/tinyproxy.py b/tests/tinyproxy.py
--- a/tests/tinyproxy.py
+++ b/tests/tinyproxy.py
@@ -54,6 +54,7 @@ 
                          self.requestline, str(code), str(size),
                          ''.join([' %s:%s' % h for h in sorted(xheaders)]))
         # Flush for Windows, so output isn't lost on TerminateProcess()
+        sys.stdout.flush()
         sys.stderr.flush()
 
     def _connect_to(self, netloc, soc):