Whamcloud - gitweb
LU-17769 tests: print subtest iter in test banner 83/56883/2
authorAndreas Dilger <adilger@whamcloud.com>
Mon, 4 Nov 2024 21:59:27 +0000 (14:59 -0700)
committerOleg Drokin <green@whamcloud.com>
Mon, 9 Dec 2024 06:13:44 +0000 (06:13 +0000)
Print the subtest iteration number/duration in the subtest banner
so that it is more visible across all of the nodes.  Otherwise, it
is only printed via "echo" into the full test script run log, and
is not shown in most of the per-subtest logs in Maloo.

Test-Parameters: trivial testlist=sanity env=ONLY=1,ONLY_REPEAT=10
Fixes: e16e3d46 ("LU-13169 tests: add ONLY_REPEAT parameter to repeat subtests")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ic13196e9bc17a51a1af7a0b5aecaafe3c5349a4c
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56883
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/test-framework.sh

index e918b3c..7798ce3 100755 (executable)
@@ -7652,17 +7652,17 @@ run_one_logged() {
        export ONLY_REPEAT_ITER=1
        while true; do
                local before_sub=$SECONDS
+               local iter
 
                log_sub_test_begin $TESTNAME
                # remove temp files between repetitions to avoid test failures
                if [[ -n "$append" ]]; then
                        [[ -n "$tdir" ]] && rm -rvf $DIR/$tdir*
                        [[ -n "$tfile" ]] && rm -vf $DIR/$tfile*
-                       echo "subtest iteration $ONLY_REPEAT_ITER/$repeat " \
-                               "($(((SECONDS-before)/60))/$ONLY_MINUTES min)"
+                       iter=" (repeat $ONLY_REPEAT_ITER/$repeat iter, $(((SECONDS-before)/60))/$ONLY_MINUTES min)"
                fi
                # loop around subshell so stack_trap EXIT triggers each time
-               (run_one $testnum "$testmsg") 2>&1 | tee -i $append $test_log
+               (run_one $testnum "$testmsg$iter") 2>&1 | tee -i $append $test_log
                rc=${PIPESTATUS[0]}
                local append=-a
                local duration_sub=$((SECONDS - before_sub))