From b0e75805eefcb09186010afc8d27748e60f80329 Mon Sep 17 00:00:00 2001 From: Ryan Moeller Date: Mon, 24 Aug 2020 11:50:15 -0400 Subject: ZTS: Improve block_device_wait on FreeBSD FreeBSD doesn't have an equivalent to udevadm settle, so we have been resorting to a three second sleep to wait for device changes to take effect. This is far from ideal. We are mainly waiting for volmode=geom zvols to appear in /dev, so as a hack, reading the geom config will have the desired effect of quiescing the geom state. Reviewed-by: Alexander Motin Reviewed-by: Brian Behlendorf Signed-off-by: Ryan Moeller Closes #10768 --- tests/zfs-tests/include/blkdev.shlib | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests/zfs-tests') diff --git a/tests/zfs-tests/include/blkdev.shlib b/tests/zfs-tests/include/blkdev.shlib index 28f439fca..b34f2c04d 100644 --- a/tests/zfs-tests/include/blkdev.shlib +++ b/tests/zfs-tests/include/blkdev.shlib @@ -81,7 +81,9 @@ function block_device_wait log_note udevadm settle time too long: $elapsed elif is_freebsd; then if [[ ${#@} -eq 0 ]]; then - sleep 3 + # Do something that has to go through the geom event + # queue to complete. + sysctl kern.geom.conftxt >/dev/null return fi fi -- cgit v1.2.3