Univention Bugzilla – Bug 31912
stdout and stderr correlation lost in ucs-test output
Last modified: 2023-03-25 06:50:33 CET
In Jenkins the test output is separated in stdout an stderr, loosing all temporal correlation. ucs-test framework should maybe redirect stderr (also) to stdout. Example: =============================================================================== Standard Ausgabe (STDOUT) ## create the GPO 'lY2yuuma' on remote DC master095.autotest095.local ## GPO was created on master095.autotest095.local with ID {AC5DE684-CE47-4AB7-B67A-4EAE0434EEE9} ## check whether the directory has been created on remote DC master095.autotest095.local ## check whether samba-tool lists the GPO on remote DC master095.autotest095.local ## check whether the directory for the GPO has been replicated to the local system (waiting about 300 seconds) ## Note: to speed things up for interactive tests, you may run /usr/share/univention-samba4/scripts/sysvol-sync.sh manually now. GPO {AC5DE684-CE47-4AB7-B67A-4EAE0434EEE9} deleted. Standard Fehler (STDERR) error 2013-07-07 20:35:17 Directory for GPO has not been created error 2013-07-07 20:35:17 **************** Test failed above this line (1) **************** ===============================================================================
I second this proposal.
Shell: exec 2>&1 Python: import os,sys;os.dup2(sys.stderr.fileno(), sys.stdout.fileno()) PS: see "Ariane 5 Flight 501" for why that its is generally a bad idea to mix it: STDOUT is for expected output/for other processes to process, STDERR is unexpected output/for diagnostics.
(In reply to Philipp Hahn from comment #2) > PS: see "Ariane 5 Flight 501" for why that its is generally a bad idea to > mix it: STDOUT is for expected output/for other processes to process, STDERR > is unexpected output/for diagnostics. For other programs I would agree. But in this case, the whole output of the script (out+err) is important for debugging/diagnostics. Solutions: 1) Always write to stdout 2) Always write to stderr 3) Merge stdout+stderr into one stream I think solution 3) would be more generic and means less changes to existing code.
r59512 | Bug #31912 test: Merge stdout and stderr in output
(In reply to Philipp Hahn from comment #4) > r59512 | Bug #31912 test: Merge stdout and stderr in output Seems like it breaks the output when an iterable is printed like print "Foo is:", some_list I see the following: [ 0.575]Installed Apps are: [ 0.575] [ 0.575][ [ 0.575]' [ 0.575]k [ 0.575]o [ 0.576]l [ 0.576]a [ 0.576]b [ 0.576]- [ 0.576]e [ 0.576]n [ 0.576]t [ 0.576]e [ 0.576]r [ 0.576]p [ 0.576]r [ 0.576]i [ 0.576]s [ 0.576]e [ 0.576]' [ 0.576]] [ 0.576]
This is the failed test: <http://jenkins.knut.univention.de:8080/job/UCS-4.0/job/UCS-4.0-1/job/UCS%204.0%20App%20Autotest%20MultiEnv/lastCompletedBuild/SambaVersion=s4,Systemrolle=master/testReport/20_appcenter/18_check_app_links/test/> r59787 | Bug #31912 test: Merge stdout and stderr in output Collect continuous output of up to .1s. Use absolute time stamp instead of relative delta.
r60277 | Bug #31912 test: Fix merged stdout and stderr reading Fixed deadlock reading wrong PIPE Package: ucs-test Version: 5.0.147-1.1043.201504291033 Branch: ucs_4.0-0 Scope: errata4.0-1
For this bug is no separate QA needed.