Message ID | b393419eff2e5fbb512be59d30ba8106afc63700.1632492293.git.fdmanana@suse.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | btrfs/179: fix test failure when there are no snapshots to delete | expand |
diff --git a/tests/btrfs/179 b/tests/btrfs/179 index 9a3b36ab..2f17c9f9 100755 --- a/tests/btrfs/179 +++ b/tests/btrfs/179 @@ -70,6 +70,10 @@ delete_workload() while true; do sleep $((sleep_time * 2)) victim=$(ls "$SCRATCH_MNT/snapshots" | sort -R | head -n1) + if [ -z "$victim" ]; then + # No snapshots available, sleep and retry later. + continue + fi $BTRFS_UTIL_PROG subvolume delete \ "$SCRATCH_MNT/snapshots/$victim" > /dev/null done