Whamcloud - gitweb
LU-16541 tests: Improve test 64f 96/52096/2
authorPatrick Farrell <pfarrell@whamcloud.com>
Tue, 22 Aug 2023 16:32:52 +0000 (12:32 -0400)
committerOleg Drokin <green@whamcloud.com>
Wed, 20 Dec 2023 03:46:35 +0000 (03:46 +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.

Lustre-commit: 33e4d86a480b860e0a3b4b51c7c6da6ec0159e51
Lustre-change: https://review.whamcloud.com/52040

Test-Parameters: trivial
Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: I25b825e1d9d516635ef8cbd26dd12809625c34df
Reviewed-by: xinliang <xinliang.liu@linaro.org>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52096
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/tests/sanity.sh

index 35ceaa5..f650600 100755 (executable)
@@ -8979,18 +8979,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"
 }