From: Mr NeilBrown Date: Wed, 23 Sep 2020 05:23:46 +0000 (+1000) Subject: LU-13982 tests: fix infinite loop in sanity test_184c X-Git-Tag: 2.13.57~153 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F07%2F40007%2F4;p=fs%2Flustre-release.git LU-13982 tests: fix infinite loop in sanity test_184c If the dd in test_184c fails to create the file, for example due to ENOSPC, the subsequent "while" loops indefinitely. So add a loop-count to ensure it stops eventually. Also change the test from "-f" to "-s" so we wait for the file to be non-empty. Test-Parameters: trivial Signed-off-by: Mr NeilBrown Change-Id: I5051adf101f08856b97fa994f687b976fda84df4 Reviewed-on: https://review.whamcloud.com/40007 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: James Nunez --- diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index adcf85b..4212768 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -16022,8 +16022,9 @@ test_184c() { dd if=$ref1 of=$file1 bs=16k & local DD_PID=$! - # Make sure dd starts to copy file - while [ ! -f $file1 ]; do sleep 0.1; done + # Make sure dd starts to copy file, but wait at most 5 seconds + local loops=0 + while [ ! -s $file1 -a $((loops++)) -lt 50 ]; do sleep 0.1; done $LFS swap_layouts $file1 $file2 local rc=$?