aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2024-03-05 19:52:03 +0100
committerZorro Lang <zlang@kernel.org>2024-03-11 12:50:09 +0800
commit18ecbf559bc5bf60329ec5aeb415c77a88ba6215 (patch)
tree1346602a4bb21d6c094bace6b2fa988577d6303a
parent2b0216017bc2b20bf38bd3461d474c9f752b8aaa (diff)
downloadxfstests-dev-18ecbf559bc5bf60329ec5aeb415c77a88ba6215.tar.gz
btrfs/011: increase the runtime for replace cancel
This test exercises the btrfs replace cancel path, but in order to do this we have to have enough work to do in order to successfully cancel the balance, otherwise the test fails because the operation has completed before we're able to cancel. This test has a very low pass rate because we do not generate a large enough file system for replace to have enough work, passing around 5% of the time. Increase the time spent to 10x the time we wait for the replace to start its work before we cancel, this allows us to consistently pass this test. Reviewed-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Anand Jain <anand.jain@oracle.com>
-rwxr-xr-xtests/btrfs/0119
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/btrfs/011 b/tests/btrfs/011
index ff52ada94a..d8b5a97827 100755
--- a/tests/btrfs/011
+++ b/tests/btrfs/011
@@ -60,6 +60,7 @@ wait_time=1
fill_scratch()
{
local fssize=$1
+ local with_cancel=$2
local filler_pid
# Fill inline extents.
@@ -88,7 +89,11 @@ fill_scratch()
$XFS_IO_PROG -f -d -c "pwrite -b 64k 0 1E" "$SCRATCH_MNT/t_filler" &>\
$tmp.filler_result &
filler_pid=$!
- sleep $((2 * $wait_time))
+ if [ "${with_cancel}" = "cancel" ]; then
+ sleep $((10 * $wait_time))
+ else
+ sleep $((2 * $wait_time))
+ fi
kill -KILL $filler_pid &> /dev/null
wait $filler_pid &> /dev/null
@@ -125,7 +130,7 @@ workout()
_scratch_mount
_require_fs_space $SCRATCH_MNT $((2 * 512 * 1024)) #2.5G
- fill_scratch $fssize
+ fill_scratch $fssize $with_cancel
_run_btrfs_util_prog filesystem show -m $SCRATCH_MNT
echo -e "Replace from $source_dev to $SPARE_DEV\\n" >> $seqres.full