Skip to content

Commit

Permalink
Update event timeout for copy storage migration
Browse files Browse the repository at this point in the history
It takes longer to get the desired event in copy storage migration.
So update event timeout.

Signed-off-by: lcheng <[email protected]>
  • Loading branch information
cliping committed Nov 14, 2023
1 parent 291ae9f commit 25b6c13
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion virttest/migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,16 +408,19 @@ def _run_complex_func(vm, one_func, virsh_event_session=None):
after_event = one_func.get('after_event')
before_event = one_func.get('before_event')
func = one_func.get('func')
wait_for_event_timeout = one_func.get('wait_for_event_timeout')
if after_event and not virsh_event_session:
raise exceptions.TestError("virsh session for collecting domain "
"events is not provided")

if not wait_for_event_timeout:
wait_for_event_timeout = '30'
if after_event:
LOG.debug("Below events are received:"
"%s", virsh_event_session.get_stripped_output())
if not utils_misc.wait_for(
lambda: re.findall(after_event,
virsh_event_session.get_stripped_output()), 30):
virsh_event_session.get_stripped_output()), wait_for_event_timeout):
raise exceptions.TestError("Unable to find "
"event {}".format(after_event))
LOG.debug("Receive the event '{}'".format(after_event))
Expand Down

0 comments on commit 25b6c13

Please sign in to comment.