From: Darrick J. Wong Date: Tue, 27 Feb 2024 02:01:19 +0000 (-0800) Subject: generic/192: fix spurious timeout X-Git-Tag: v2024.03.17~19 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=0943fadcf0e934ef65413f459a5b46e4d2e75432;p=xfstests-dev.git generic/192: fix spurious timeout I have a theory that when the nfs server that hosts the root fs for my testing VMs gets backed up, it can take a while for path resolution and loading of echo, cat, or tee to finish. That delays the test enough to result in: --- /tmp/fstests/tests/generic/192.out 2023-11-29 15:40:52.715517458 -0800 +++ /var/tmp/fstests/generic/192.out.bad 2023-12-15 21:28:02.860000000 -0800 @@ -1,5 +1,6 @@ QA output created by 192 sleep for 5 seconds test -delta1 is in range +delta1 has value of 12 +delta1 is NOT in range 5 .. 7 delta2 is in range Therefore, invoke all these utilities with --help before the critical section to make sure they're all in memory. Signed-off-by: "Darrick J. Wong" Reviewed-by: Zorro Lang Reviewed-by: Christoph Hellwig Signed-off-by: Zorro Lang --- diff --git a/tests/generic/192 b/tests/generic/192 index 0d3cd03b..28254866 100755 --- a/tests/generic/192 +++ b/tests/generic/192 @@ -29,17 +29,27 @@ delay=5 testfile=$TEST_DIR/testfile rm -f $testfile +# Preload every binary used between sampling time1 and time2 so that loading +# them has minimal overhead even if the root fs is hosted over a slow network. +# Also don't put pipe and tee creation in that critical section. +for i in echo stat sleep cat; do + $i --help &>/dev/null +done + echo test >$testfile -time1=`_access_time $testfile | tee -a $seqres.full` +time1=`_access_time $testfile` +echo $time1 >> $seqres.full echo "sleep for $delay seconds" sleep $delay # sleep to allow time to move on for access cat $testfile -time2=`_access_time $testfile | tee -a $seqres.full` +time2=`_access_time $testfile` +echo $time2 >> $seqres.full cd / _test_cycle_mount -time3=`_access_time $testfile | tee -a $seqres.full` +time3=`_access_time $testfile` +echo $time3 >> $seqres.full delta1=`expr $time2 - $time1` delta2=`expr $time3 - $time1`