python -m test -jN: write stderr in stdout to get messages in order #89573
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
assignee = None closed_at = <Date 2022-04-03.03:51:25.367> created_at = <Date 2021-10-08.11:15:36.418> labels = ['tests', '3.11'] title = 'python -m test -jN: write stderr in stdout to get messages in order' updated_at = <Date 2022-04-03.03:51:25.367> user = 'https://github.com/vstinner'
activity = <Date 2022-04-03.03:51:25.367> actor = 'vstinner' assignee = 'none' closed = True closed_date = <Date 2022-04-03.03:51:25.367> closer = 'vstinner' components = ['Tests'] creation = <Date 2021-10-08.11:15:36.418> creator = 'vstinner' dependencies =  files =  hgrepos =  issue_num = 45410 keywords = ['patch'] message_count = 9.0 messages = ['403467', '403480', '403677', '403686', '403707', '403766', '403781', '403827', '403844'] nosy_count = 1.0 nosy_names = ['vstinner'] pr_nums = ['28819', '28885', '28908', '28915', '28926'] priority = 'normal' resolution = 'fixed' stage = 'resolved' status = 'closed' superseder = None type = None url = 'https://bugs.python.org/issue45410' versions = ['Python 3.11']
The text was updated successfully, but these errors were encountered:
In buildbot logs, when a worker process is run, two pipes are created for stdout and stderr. The problem is that using two pipes produce an output which is hard to read.
I would prefer:
0:01:10 load avg: 4.48 [236/427/1] test_ftplib failed (env changed) -- (...) Warning -- Uncaught thread exception: Exception Exception in thread Thread-67: Traceback (most recent call last): (...) Exception test__all__ (test.test_ftplib.MiscTestCase) ... ok test_abort (test.test_ftplib.TestFTPClass) ... ok test_acct (test.test_ftplib.TestFTPClass) ... ok test_all_errors (test.test_ftplib.TestFTPClass) ... ok (...) Ran 94 tests in 2.326s
The Warning is logged at the beginning, it's not possible to know which test emitted this warning.
I propose to write stdout and stderr of a worker process into a single pipe to keep messages order.
In the past, I saw buildbot logging stderr messages in a different color. But it no longer seems to be the case.
I'm working on a PR.
Sadly, a recent build failure (at commit 560a79f) still write "Uncaught thread exception" at the top of logs:
Calling sys.stdout doesn't help :-(
Fail at commit ce3489c:
The warning cannot come from MiscTestCase.test__all__(), so the warning is still logged at the wrong place.