summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul J. Davis <paul.joseph.davis@gmail.com>2014-02-06 17:31:59 -0600
committerPaul J. Davis <paul.joseph.davis@gmail.com>2014-02-06 21:09:31 -0600
commitf2393c0e51904f5db31a7cc54ccc8b6c1bd99f3a (patch)
treecd2d7fccd372fbcfbfd8956213027d7638d7b6b1
parent59abf55f0f5857f60cc93f68cd459a765102a654 (diff)
downloadcouchdb-f2393c0e51904f5db31a7cc54ccc8b6c1bd99f3a.tar.gz
Avoid iterating pipe handles for latency
Aparrently the line iterator on these pipe objects introduces a bit of latency. The delayed_commits test breaks if the server doesn't restart within a second so this is the fix.
-rwxr-xr-xtest/javascript/run8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/javascript/run b/test/javascript/run
index fa7f39190..e120d72ad 100755
--- a/test/javascript/run
+++ b/test/javascript/run
@@ -55,9 +55,13 @@ def run_couchjs(test):
stdout = sp.PIPE,
stderr = sys.stderr
)
- for line in p.stdout:
+ while True:
+ line = p.stdout.readline()
+ if not line:
+ break
if line.strip() == "restart":
- print "reboot_nodes()"
+ sys.stdout.write("reboot_nodes()" + os.linesep)
+ sys.stdout.flush()
else:
sys.stderr.write(line)
p.wait()