From 42f012d3c2cfdd636f94cdd758b1fddccc3c816e Mon Sep 17 00:00:00 2001 From: Yang Sheng Date: Thu, 24 Dec 2015 10:43:30 +0800 Subject: [PATCH] LU-7587 tests: fix sanity test_231a on SLES12 Flush out write RPC to ensure it is finished before we read statistic data from proc. Signed-off-by: Yang Sheng Change-Id: I8b40654cb95b151fe82067ec979dcf9f604355dc Reviewed-on: http://review.whamcloud.com/17722 Tested-by: Jenkins Reviewed-by: Bob Glossman Reviewed-by: Jian Yu Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/tests/sanity.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index f696fe0..ccf10b3 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -13128,16 +13128,20 @@ test_231a() # clear the OSC stats $LCTL set_param osc.*.stats=0 &>/dev/null + stop_writeback # Client writes $bulk_size - there must be 1 rpc for $max_pages. dd if=/dev/zero of=$DIR/$tdir/$tfile bs=$bulk_size count=1 \ oflag=direct &>/dev/null || error "dd failed" + sync; sleep 1; sync # just to be safe local nrpcs=$($LCTL get_param osc.*.stats |awk '/ost_write/ {print $2}') if [ x$nrpcs != "x1" ]; then - error "found $nrpc ost_write RPCs, not 1 as expected" + $LCTL get_param osc.*.stats + error "found $nrpcs ost_write RPCs, not 1 as expected" fi + start_writeback # Drop the OSC cache, otherwise we will read from it cancel_lru_locks osc @@ -13150,7 +13154,8 @@ test_231a() nrpcs=$($LCTL get_param osc.*.stats | awk '/ost_read/ { print $2 }') if [ x$nrpcs != "x1" ]; then - error "found $nrpc ost_read RPCs, not 1 as expected" + $LCTL get_param osc.*.stats + error "found $nrpcs ost_read RPCs, not 1 as expected" fi } run_test 231a "checking that reading/writing of BRW RPC size results in one RPC" -- 1.8.3.1