From 478ca310b4204b4354245e6261edae6fef0ae497 Mon Sep 17 00:00:00 2001 From: Patrick Farrell Date: Tue, 22 Aug 2023 12:32:52 -0400 Subject: [PATCH] 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. Lustre-commit: 33e4d86a480b860e0a3b4b51c7c6da6ec0159e51 Lustre-change: https://review.whamcloud.com/52040 Test-Parameters: trivial Signed-off-by: Patrick Farrell Change-Id: I25b825e1d9d516635ef8cbd26dd12809625c34df Reviewed-by: xinliang Reviewed-by: Andreas Dilger Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52096 Reviewed-by: James Simmons Reviewed-by: Oleg Drokin Tested-by: jenkins Tested-by: Maloo --- 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 35ceaa5..f650600 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -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" } -- 1.8.3.1