Whamcloud - gitweb
LU-16541 tests: Improve test 64f 40/52040/5
authorPatrick Farrell <pfarrell@whamcloud.com>
Tue, 22 Aug 2023 16:32:52 +0000 (12:32 -0400)
committerOleg Drokin <green@whamcloud.com>
Fri, 25 Aug 2023 16:15:58 +0000 (16:15 +0000)
The buffered IO part of test 64f has several timing related
holes and other oddities.  The use of multiop in the
background does not guarantee the RPC will not be sent, AND
the test doesn't kill it correctly.

Clean this up and make a more reliable version of the test.
Hopefully this will resolve the failure issues, if not, a
better version of the test will allow debugging.

Test-Parameters: trivial
Test-Parameters: testlist=sanity envdefinitions=ONLY=64f,ONLY_REPEAT=20
Test-Parameters: testlist=sanity envdefinitions=ONLY=64f,ONLY_REPEAT=20
Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: I25b825e1d9d516635ef8cbd26dd12809625c34df
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52040
Reviewed-by: xinliang <xinliang.liu@linaro.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
lustre/tests/sanity.sh

index d5bbea5..c7186a1 100755 (executable)
@@ -9636,18 +9636,23 @@ test_64f() {
 
        $LFS setstripe -c 1 -i 0 $DIR/$tfile || error "lfs setstripe failed"
 
-       local cmd="oO_WRONLY:w${write_bytes}_yc"
+       # Testing that buffered IO consumes grant on the client
 
-       $MULTIOP $DIR/$tfile $cmd &
-       MULTIPID=$!
-       sleep 1
+       # Delay the RPC on the server so it's guaranteed to not complete even
+       # if the RPC is sent from the client
+       #define OBD_FAIL_PTLRPC_PAUSE_REQ        0x50a
+       $LCTL set_param fail_loc=0x50a fail_val=3
+       dd if=/dev/zero of=$DIR/$tfile bs=$write_bytes count=1 conv=notrunc ||
+               error "error writing to $DIR/$tfile with buffered IO"
 
        check_grants $osc_tgt $((init_grants - grants)) \
                "buffered io, not write rpc"
 
-       kill -USR1 $MULTIPID
-       wait
+       # Clear the fail loc and do a sync on the client
+       $LCTL set_param fail_loc=0 fail_val=0
+       sync
 
+       # RPC is now known to have sent
        check_grants $osc_tgt $((init_grants - grants + chunk)) \
                "buffered io, one RPC"
 }