SVN: zope.testing/branches/benji-parallelize-subprocesses/src/zope/testing/testrunner/runner.py fix a bug (inherited from the trunk) that causes any subprocesses that generate
Benji York <[email protected]>
| Newsgroups | gmane.comp.web.zope.zope3.cvs |
|---|---|
| Message-ID | <20080705005912.8744C399A5__8213.6642923162$1215219632$gmane$org@mail.zope.org> |
Log message for revision 88029:
fix a bug (inherited from the trunk) that causes any subprocesses that generate
output on stderr to report an error (and not have their successes, failure,
etc. counted); needs tests
Changed:
U zope.testing/branches/benji-parallelize-subprocesses/src/zope/testing/testrunner/runner.py
-=-
Modified: zope.testing/branches/benji-parallelize-subprocesses/src/zope/testing/testrunner/runner.py
===================================================================
--- zope.testing/branches/benji-parallelize-subprocesses/src/zope/testing/testrunner/runner.py 2008-07-05 00:49:47 UTC (rev 88028)
+++ zope.testing/branches/benji-parallelize-subprocesses/src/zope/testing/testrunner/runner.py 2008-07-05 00:59:12 UTC (rev 88029)
@@ -410,15 +410,24 @@
else:
break
- line = suberr.readline()
- try:
- ran, nfail, nerr = map(int, line.strip().split())
- except KeyboardInterrupt:
- raise
- except:
- raise SubprocessError(
- 'No subprocess summary found', line+suberr.read())
+ # Subprocesses may have spewed any number of things to stderr, so we'll
+ # keep looking until we find the information we're looking for.
+ whole_suberr = ''
+ while True:
+ line = suberr.readline()
+ whole_suberr += line
+ if not line:
+ raise SubprocessError(
+ 'No subprocess summary found', whole_suberr)
+ try:
+ ran, nfail, nerr = map(int, line.strip().split())
+ break
+ except KeyboardInterrupt:
+ raise
+ except:
+ continue
+
while nfail > 0:
nfail -= 1
failures.append((suberr.readline().strip(), None))