aboutsummaryrefslogtreecommitdiffstats
path: root/tests/zfs-tests
diff options
context:
space:
mode:
authorнаб <[email protected]>2021-03-29 15:21:54 +0200
committerBrian Behlendorf <[email protected]>2021-04-14 13:19:49 -0700
commitfa991f2a47af29d0ae6de1b4e7737f5b9d3d0818 (patch)
tree21f1da7ed2b205cdda85ea6d3cadf8ae09172423 /tests/zfs-tests
parentdbf8baf8dd6f767777c9a3219ae9c4dd601f90a4 (diff)
zed: allow limiting concurrent jobs
200ms time-out is relatively long, but if we already hit the cap, then we'll likely be able to spawn multiple new jobs when we wake up Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11807
Diffstat (limited to 'tests/zfs-tests')
-rw-r--r--tests/zfs-tests/include/libtest.shlib19
-rwxr-xr-xtests/zfs-tests/tests/functional/events/zed_rc_filter.ksh1
2 files changed, 10 insertions, 10 deletions
diff --git a/tests/zfs-tests/include/libtest.shlib b/tests/zfs-tests/include/libtest.shlib
index bd77bae7d..c3b1adc93 100644
--- a/tests/zfs-tests/include/libtest.shlib
+++ b/tests/zfs-tests/include/libtest.shlib
@@ -3705,8 +3705,8 @@ function zed_start
# run ZED in the background and redirect foreground logging
# output to $ZED_LOG.
log_must truncate -s 0 $ZED_DEBUG_LOG
- log_must eval "zed -vF -d $ZEDLET_DIR -p $ZEDLET_DIR/zed.pid -P $PATH" \
- "-s $ZEDLET_DIR/state 2>$ZED_LOG &"
+ log_must eval "zed -vF -d $ZEDLET_DIR -P $PATH" \
+ "-s $ZEDLET_DIR/state -j 1 2>$ZED_LOG &"
fi
return 0
@@ -3722,14 +3722,13 @@ function zed_stop
fi
log_note "Stopping ZED"
- if [[ -f ${ZEDLET_DIR}/zed.pid ]]; then
- zedpid=$(<${ZEDLET_DIR}/zed.pid)
- kill $zedpid
- while ps -p $zedpid > /dev/null; do
- sleep 1
- done
- rm -f ${ZEDLET_DIR}/zed.pid
- fi
+ while true; do
+ zedpids="$(pgrep -x zed)"
+ [ "$?" -ne 0 ] && break
+
+ log_must kill $zedpids
+ sleep 1
+ done
return 0
}
diff --git a/tests/zfs-tests/tests/functional/events/zed_rc_filter.ksh b/tests/zfs-tests/tests/functional/events/zed_rc_filter.ksh
index 44652ee4c..0bef0ef1f 100755
--- a/tests/zfs-tests/tests/functional/events/zed_rc_filter.ksh
+++ b/tests/zfs-tests/tests/functional/events/zed_rc_filter.ksh
@@ -49,6 +49,7 @@ log_assert "Verify zpool sub-commands generate expected events"
log_onexit cleanup
log_must zpool events -c
+log_must zed_stop
log_must zed_start
# Backup our zed.rc