From 33e4d86a480b860e0a3b4b51c7c6da6ec0159e51 Mon Sep 17 00:00:00 2001 From: Patrick Farrell Date: Tue, 22 Aug 2023 12:32:52 -0400 Subject: [PATCH 1/1] LU-16541 tests: Improve test 64f 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 Change-Id: I25b825e1d9d516635ef8cbd26dd12809625c34df Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52040 Reviewed-by: xinliang Reviewed-by: Oleg Drokin Reviewed-by: Andreas Dilger Tested-by: Maloo Tested-by: jenkins --- lustre/tests/sanity.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index d5bbea5..c7186a1 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -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" } -- 1.8.3.1