Commit 43470277 authored by dpranke@chromium.org's avatar dpranke@chromium.org

Don't buffer output in-memory for rietveld server - it logs to stdout by

default and can fill the pipe used by subprocess.Popen(), leading to
hangs.

Review URL: http://codereview.chromium.org/6684025

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@78084 0039d316-1c4b-4281-b951-d872f2087c98
parent 1a5cb6e5
......@@ -96,16 +96,16 @@ class LocalRietveld(object):
self.install_prerequisites()
self.port = find_free_port()
if verbose:
stdout = None
stderr = None
self.out = None
self.err = None
else:
stdout = subprocess.PIPE
stderr = subprocess.PIPE
self.out = open(os.devnull, 'w')
self.err = open(os.devnull, 'w')
output = []
self.test_server = subprocess.Popen(
[self.dev_app, self.rietveld, '--port=%d' % self.port,
'--datastore_path=' + os.path.join(self.rietveld, 'tmp.db'), '-c'],
stdout=stdout, stderr=stderr, env=self.env)
stdout=self.out, stderr=self.err, env=self.env)
# Loop until port 127.0.0.1:port opens or the process dies.
while not test_port(self.port):
self.test_server.poll()
......@@ -120,6 +120,12 @@ class LocalRietveld(object):
self.test_server.kill()
self.test_server = None
self.port = None
if self.out:
self.out.close()
self.out = None
if self.err:
self.err.close()
self.err = None
def main():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment