Skip to content

Commit fbf8de4

Browse files
committed
tests: fix a test framework race condition and spurious output
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]> (imported from commit 0ab53f9) Signed-off-by: Paul Moore <[email protected]>
1 parent 9d2478c commit fbf8de4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/regression

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ EOF
130130
function match_csv_word() {
131131
[[ -z $1 || -z $2 ]] && return 1
132132

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

136136
#
@@ -1036,6 +1036,8 @@ function run_tests() {
10361036
fi
10371037

10381038
# run the test batch
1039+
> $batch_name.$mode.log
1040+
> $batch_name.$mode.stats
10391041
run_test_batch $batch_name >& $batch_name.$mode.log &
10401042
job_pids[job_cnt]=$!
10411043
job_logs[job_cnt]=$batch_name.$mode.log

0 commit comments

Comments
 (0)