зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset e08c785a4008 (bug 798300) for frequent mochitest-bc window leaks.
--HG-- extra : rebase_source : 6ff2883865a97d63a788234e0c48c6c3e877abf9
This commit is contained in:
Родитель
eb57959ceb
Коммит
6d13980c63
|
@ -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.STDOUT
|
||||
if processStderrLine:
|
||||
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.reader = ProcessReader(stdout_callback=processOutputLine,
|
||||
stderr_callback=processStderrLine,
|
||||
finished_callback=onFinish,
|
||||
|
|
|
@ -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
|
|
@ -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()
|
||||
|
|
Загрузка…
Ссылка в новой задаче