mirror of
https://github.com/python/cpython.git
synced 2025-11-11 22:55:08 +00:00
bpo-30258: regrtest: Fix run_tests_multiprocess() (#1479)
If the child process exited with a non-zero code, don't strip the last line of stdout anymore. Add also a sanity check in accumulate_result().
This commit is contained in:
parent
9da408d15b
commit
74683fc624
2 changed files with 3 additions and 1 deletions
|
|
@ -116,6 +116,8 @@ class Regrtest:
|
||||||
elif ok == RESOURCE_DENIED:
|
elif ok == RESOURCE_DENIED:
|
||||||
self.skipped.append(test)
|
self.skipped.append(test)
|
||||||
self.resource_denieds.append(test)
|
self.resource_denieds.append(test)
|
||||||
|
elif ok != INTERRUPTED:
|
||||||
|
raise ValueError("invalid test result: %r" % ok)
|
||||||
|
|
||||||
def display_progress(self, test_index, test):
|
def display_progress(self, test_index, test):
|
||||||
if self.ns.quiet:
|
if self.ns.quiet:
|
||||||
|
|
|
||||||
|
|
@ -124,13 +124,13 @@ class MultiprocessThread(threading.Thread):
|
||||||
finally:
|
finally:
|
||||||
self.current_test = None
|
self.current_test = None
|
||||||
|
|
||||||
stdout, _, result = stdout.strip().rpartition("\n")
|
|
||||||
if retcode != 0:
|
if retcode != 0:
|
||||||
result = (CHILD_ERROR, "Exit code %s" % retcode)
|
result = (CHILD_ERROR, "Exit code %s" % retcode)
|
||||||
self.output.put((test, stdout.rstrip(), stderr.rstrip(),
|
self.output.put((test, stdout.rstrip(), stderr.rstrip(),
|
||||||
result))
|
result))
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
stdout, _, result = stdout.strip().rpartition("\n")
|
||||||
if not result:
|
if not result:
|
||||||
self.output.put((None, None, None, None))
|
self.output.put((None, None, None, None))
|
||||||
return True
|
return True
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue