diff options
author | Brian Behlendorf <[email protected]> | 2020-11-03 09:19:45 -0800 |
---|---|---|
committer | GitHub <[email protected]> | 2020-11-03 09:19:45 -0800 |
commit | 123d2803bfb9b754cee7e721a67a151380efd7e7 (patch) | |
tree | e82830760f207cea82f9a29752d6d824b7da7c3d /tests | |
parent | 59b687232798a4da0e7647cca19a308aa82b5fad (diff) |
ZTS: Wait on all events in events_001_pos.ksh
The events_001_pos.ksh test case can fail because it's possible,
and correct, for the config_sync event to be posted after the last
"expected" event. To accommodate this the run_and_verify() function
has been updated to wait for all non-history events, not just the
last event. This does not increase the run time of the test as
long as all the events do get generated.
Reviewed-by: George Melikov <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #11147
Diffstat (limited to 'tests')
-rw-r--r-- | tests/zfs-tests/tests/functional/events/events_common.kshlib | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/zfs-tests/tests/functional/events/events_common.kshlib b/tests/zfs-tests/tests/functional/events/events_common.kshlib index 5f4c629dc..9c5879183 100644 --- a/tests/zfs-tests/tests/functional/events/events_common.kshlib +++ b/tests/zfs-tests/tests/functional/events/events_common.kshlib @@ -119,8 +119,16 @@ function run_and_verify # If the only event is history then we don't observe zed debug log if [[ "${events[0]}" != "sysevent.fs.zfs.history_event" ]]; then - # wait for the last event to show up in the debug log - log_must file_wait_event $ZED_DEBUG_LOG ${events[-1]} + # wait for all the non-history events to show up in the + # debug log, all-debug.sh filters history events. + for event in ${events[*]}; do + if [[ "$event" == \ + "sysevent.fs.zfs.history_event" ]]; then + continue + fi + + log_must file_wait_event $ZED_DEBUG_LOG "$event" + done log_must cp $ZED_DEBUG_LOG $TMP_EVENTS_ZED log_must test -s $TMP_EVENTS_ZED |