From 15a6c58e862c73ec4756a4b7e4f4a4eb92e2b3c6 Mon Sep 17 00:00:00 2001 From: Arshad Hussain Date: Thu, 6 Jul 2023 15:55:04 +0530 Subject: [PATCH] LU-16947 tests: On error correctly kill multiop multiop_bg_pause under test-framework starts multiop in background and waits for signal if "_" option is provided. On 'verbose' mode the PAUSING string is printed on console which is checked and if not found error is reported by multiop_bg_pause function. On error, it is required to kill the existing running multiop binary and if not done will eventually timeout and not exit the test. Currently on error multiop_bg_pause function incorrectly sends signal to wrong PID. This patch fixes this issue. Test-Parameters: trivial testlist=replay-single mdscount=2 mdtcount=4 Signed-off-by: Arshad Hussain Change-Id: I3fb505302615512a891725e7339a6f0238c2cdab Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51589 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Jian Yu Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- lustre/tests/test-framework.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index d68eb37..59a6a96 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -7691,6 +7691,7 @@ multiop_bg_pause() { echo "$MULTIOP_PROG $FILE v$ARGS" $MULTIOP_PROG $FILE v$ARGS > $TMPPIPE & + local pid=$! echo "TMPPIPE=${TMPPIPE}" read -t 60 multiop_output < $TMPPIPE @@ -7701,7 +7702,7 @@ multiop_bg_pause() { rm -f $TMPPIPE if [ "$multiop_output" != "PAUSING" ]; then echo "Incorrect multiop output: $multiop_output" - kill -9 $PID + kill -9 $pid return 1 fi -- 1.8.3.1