From fbf8de4702dd98253c14826f6f3582c084f41d31 Mon Sep 17 00:00:00 2001 From: Paul Moore Date: Thu, 23 Jan 2025 18:14:06 -0500 Subject: [PATCH] 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 (imported from commit 0ab53f95006dcdc525fff175f2eff9f5a5d56883) Signed-off-by: Paul Moore --- tests/regression | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/regression b/tests/regression index ff2be56d..c08a328e 100755 --- a/tests/regression +++ b/tests/regression @@ -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" } # @@ -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