Skip to content

Commit

Permalink
tests: fix a test framework race condition and spurious output
Browse files Browse the repository at this point in the history
Force the creation of the test log and stats files before running the
test, this prevents a race condition where the framework attempts to
output the test results before the test has had a chance to run.

Quiet a grep command in the framework that was resulting in unwanted
output in the test terminal.

Signed-off-by: Paul Moore <[email protected]>
  • Loading branch information
pcmoore committed Jan 24, 2025
1 parent e6573f4 commit 0ab53f9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/regression
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ EOF
function match_csv_word() {
[[ -z $1 || -z $2 ]] && return 1

echo "$1" | sed 's/,/ /g' | grep -w "$2"
echo "$1" | sed 's/,/ /g' | grep -qw "$2"
}

#
Expand Down Expand Up @@ -1036,6 +1036,8 @@ function run_tests() {
fi

# run the test batch
> $batch_name.$mode.log
> $batch_name.$mode.stats
run_test_batch $batch_name >& $batch_name.$mode.log &
job_pids[job_cnt]=$!
job_logs[job_cnt]=$batch_name.$mode.log
Expand Down

0 comments on commit 0ab53f9

Please sign in to comment.