Tools: Test: Audio: Mitigate trace flood in process_test.m#9403
Conversation
tools/test/audio/comp_run.sh
Outdated
| cat "$FN_TRACE" | ||
| echo ---------------------------------------------------------- | ||
| exit $RETVAL | ||
| fi |
There was a problem hiding this comment.
I just realized I should to restore set -e after this error handling code. With run success there's still possibly something that could (green) fail.
There was a problem hiding this comment.
Here's how you should be able to kill all birds with one stone:
else
$VALGRIND_CMD $CMD 2> "$FN_TRACE" || {
local ret=$?
echo ----------------------------------------------------------
cat "$FN_TRACE"
echo ----------------------------------------------------------
return $ret # "exit" would be for something unexpected and catastrophic,
# not for a "regular" test failure
}No need for set -e.
I just realized I should to restore set -e after this error handling code.
You should never invoke set -e to "restore" the previous state because you may not know what this previous state was. It should always be possible to disable it globally at the top. Instead, disable errexit in a subshell (but NOT needed here):
( set +e
# code running
# without set -e
)
This restores the previous -e state on subshell exit, WHICHEVER that state was in the first place.
This also restores the previous state wherever you exit the subshell from.
The only subshell drawback is the inability for the subshell to change parent variables or other side effect.
There was a problem hiding this comment.
Thanks! I used he above code version, it works correctly for a FW error return and a valgrind issue those I tried to insert to code.
|
Converting to draft to avoid merge while work is still in progress. |
The verbose test trace flood slows down the test to near unusable test times due to a lot of text printed to Octave console. As result also the SOF CI logs become large. This patch adds redirect of testbench trace into a temporary file instead of standard output in process_test.m. The trace content is printed in comp_run.sh to console only if there has been an error. To prevent growing /tmp the trace file is deleted after test run and possible print to console. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
d5b1459 to
27dfdd3
Compare
| cat "$FN_TRACE" | ||
| echo ---------------------------------------------------------- | ||
| return $ret # "exit" would be for something unexpected and catastrophic, | ||
| # not for a "regular" test failure |
There was a problem hiding this comment.
These comments were for you, not for the final version :-) A bit verbose now but OK
There was a problem hiding this comment.
I think it fits there :)
The verbose test trace flood slows down the test to near unusable test times due to a lot of text printed to Octave console. As result also the SOF CI logs become large.
This patch adds redirect of testbench trace into a temporary file instead of standard output in process_test.m. The trace content is printed in comp_run.sh to console only if there has been an error. To prevent growing /tmp the trace file is deleted after test run and possible print to console.