From 7d3f9bf4935d090915131584498212bc120f1d8b Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Mon, 21 Jun 2021 12:34:07 +0100 Subject: [PATCH] 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 --- test/units/testsuite-02.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/units/testsuite-02.sh b/test/units/testsuite-02.sh index da02304a32..bf9a65972f 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