Starting the quota grace period doesn't necessary happen predictably
when the system is under heavy load. This results in random test
failures where grace period timeouts are expected.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Zorro lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
# raw ("since epoch") grace expiry
get=`repquota -up $SCRATCH_MNT | grep "^$qa_user" | awk '{print $NF}'`
-# Either the new expiry must match; or be one second after the set time, to
-# deal with the seconds counter incrementing.
-if [ "$get" != "$set" ] && [ "$get" -ne "$((set + 1))" ]; then
+# Either the new expiry must match or be soon after the set time as there
+# may be load related delays on setting the new timer. A 10s "grace" window
+# should be enough for everyone.
+if [ "$get" != "$set" ] && [ "$get" -gt "$((set + 10))" ]; then
echo "set grace to $set but got grace $get"
fi
echo
echo "*** push past the soft block limit" | tee -a $seqres.full
_file_as_id $SCRATCH_MNT/softie $id $type $bsize 300
+
+ # sync so that the data is actually allocated as soft limit timers
+ # are not started until block allocation is done. This means the test
+ # will work even if remount sliently fails due to busy mounts
+ _scratch_sync
_qmount
$XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
-c "repquota -birnN -$type" $SCRATCH_DEV |