]> git.proxmox.com Git - mirror_zfs.git/blobdiff - tests/zfs-tests/tests/functional/features/async_destroy/async_destroy_001_pos.ksh
OpenZFS 7614, 9064 - zfs device evacuation/removal
[mirror_zfs.git] / tests / zfs-tests / tests / functional / features / async_destroy / async_destroy_001_pos.ksh
index b9f1837d622c3c8bcc07d51336f8d4c82e60d405..20b61da92dfb6a091baadb60418508556c0d15dd 100755 (executable)
@@ -46,29 +46,32 @@ TEST_FS=$TESTPOOL/async_destroy
 
 verify_runnable "both"
 
-# See issue: https://github.com/zfsonlinux/zfs/issues/5479
-if is_kmemleak; then
-       log_unsupported "Test case runs slowly when kmemleak is enabled"
-fi
-
 function cleanup
 {
        datasetexists $TEST_FS && log_must zfs destroy $TEST_FS
+       log_must set_tunable64 zfs_async_block_max_blocks 100000
 }
 
 log_onexit cleanup
 log_assert "async_destroy can suspend and resume traversal"
 
-log_must zfs create -o recordsize=512 -o compression=off $TEST_FS
+log_must zfs create -o recordsize=1k -o compression=off $TEST_FS
+
+# Fill with 128,000 blocks.
+log_must dd bs=1024k count=128 if=/dev/zero of=/$TEST_FS/file
 
-# Fill with 1G
-log_must dd bs=1024k count=1024 if=/dev/zero of=/$TEST_FS/file
+#
+# Decrease the max blocks to free each txg, so that freeing takes
+# long enough that we can observe it.
+#
+log_must set_tunable64 zfs_async_block_max_blocks 100
 
+log_must sync
 log_must zfs destroy $TEST_FS
 
 #
 # We monitor the freeing property, to verify we can see blocks being
-# freed while the suspend/resume code is exerciesd.
+# freed while the suspend/resume code is exercised.
 #
 t0=$SECONDS
 count=0
@@ -80,6 +83,13 @@ done
 
 [[ $count -eq 0 ]] && log_fail "Freeing property remained empty"
 
+#
+# After a bit, go back to allowing an unlimited amount of freeing
+# per txg.
+#
+sleep 10
+log_must set_tunable64 zfs_async_block_max_blocks 100000
+
 # Wait for everything to be freed.
 while [[ "0" != "$(zpool list -Ho freeing $TESTPOOL)" ]]; do
        [[ $((SECONDS - t0)) -gt 180 ]] && \