From: Luca Boccassi Date: Mon, 21 Jun 2021 11:34:07 +0000 (+0100) Subject: test: do not lose logs of late failures in TEST-02-UNITTESTS X-Git-Tag: v249-rc2~31^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d3f9bf4935d090915131584498212bc120f1d8b;p=thirdparty%2Fsystemd.git test: do not lose logs of late failures in TEST-02-UNITTESTS Due to set -e, if the wait() fails (eg: because of an assert in the waited task), report_result() never runs and logs are lost --- diff --git a/test/units/testsuite-02.sh b/test/units/testsuite-02.sh index da02304a32a..bf9a65972f0 100755 --- a/test/units/testsuite-02.sh +++ b/test/units/testsuite-02.sh @@ -78,10 +78,12 @@ done # Wait for remaining running tasks for key in "${!running[@]}"; do - wait ${running[$key]} - ec=$? + wait ${running[$key]} && ec=0 || ec=$? report_result "$key" $ec unset running["$key"] done +# Test logs are sometimes lost, as the system shuts down immediately after +journalctl --sync + exit 0