Backed out changeset e08c785a4008 (bug 798300) for frequent mochitest-bc window leaks.

This commit is contained in:
Ryan VanderMeulen 2015-03-30 14:25:34 -04:00
parent 92ab9627ab
commit dc212799b8
3 changed files with 3 additions and 40 deletions

View File

@ -645,16 +645,9 @@ falling back to not using job objects for managing child processes"""
self.kill()
onTimeout.insert(0, on_timeout)
# Always use another stream for stderr else stdout/stderr may be merged
# (even on posix in case the streams of the processes are not opened
# fully unbuffered)
self._stderr = subprocess.PIPE
if not processStderrLine:
# default behaviour is to use the callbacks from processOutputLine
# for stdout and stderr if no processStderrLine callbacks are
# specified
processStderrLine = processOutputLine
self._stderr = subprocess.STDOUT
if processStderrLine:
self._stderr = subprocess.PIPE
self.reader = ProcessReader(stdout_callback=processOutputLine,
stderr_callback=processStderrLine,
finished_callback=onFinish,

View File

@ -1,7 +0,0 @@
import sys
# try to write out enough output to overflow the OS buffer
# for both stdout and stderr.
for i in xrange(50):
print "O" * 100
print >>sys.stderr, "X" * 100

View File

@ -1,6 +1,5 @@
#!/usr/bin/env python
import sys
import io
import os
import unittest
@ -65,27 +64,5 @@ class ProcTestOutput(proctest.ProcTest):
False,
())
def test_stdout_stderr_mixing(self):
"""
Test that stdout and stderr don't get intermingled within a line.
"""
got_output = [False]
def processOutput(line):
got_output[0] = True
self.assertTrue(len(line) == 100 and
(all(c == 'O' for c in line) or
all(c == 'X' for c in line)),
"stdout and stderr should not be mixed")
test_script = os.path.join(here, "gen_stdout_stderr.py")
proc = processhandler.ProcessHandler(
[sys.executable, test_script],
processOutputLine=[processOutput]
)
proc.run()
proc.wait()
self.assertTrue(got_output[0], "Saw output from process")
if __name__ == '__main__':
unittest.main()