diff mbox series

[5/5] btrfs/282: increase throttled scrub rate tolerance

Message ID 20231207072056.14588-6-ddiss@suse.de (mailing list archive)
State New, archived
Headers show
Series btrfs/282: resolve intermittent failures | expand

Commit Message

David Disseldorp Dec. 7, 2023, 7:20 a.m. UTC
Even with dmdelay injected latencies, I still observe occasional test
failures on shared storage (e.g. VMs). The extra 10% tolerance resolves
these intermittent failures on my system.

Signed-off-by: David Disseldorp <ddiss@suse.de>
---
 tests/btrfs/282 | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/tests/btrfs/282 b/tests/btrfs/282
index 42d992a6..6649623a 100755
--- a/tests/btrfs/282
+++ b/tests/btrfs/282
@@ -95,9 +95,8 @@  speed=$($BTRFS_UTIL_PROG scrub status --raw $SCRATCH_MNT |\
 	tee -a $seqres.full |\
 	$AWK_PROG '$1 == "Rate:" {sub(/\/s/, "", $2); print $2}')
 
-# We gave a +- 10% tolerance for the throttle
-if [ "$speed" -gt "$(( $target_speed * 11 / 10 ))" -o \
-     "$speed" -lt "$(( $target_speed * 9 / 10))" ]; then
+# We gave a +- 20% tolerance for the throttle
+if (( speed > target_speed * 12 / 10 || speed < target_speed * 8 / 10 )); then
 	echo "scrub speed $speed Bytes/s is not properly throttled, target is $target_speed Bytes/s"
 fi