-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update event timeout for copy storage migration #3789
Conversation
Test result in autotest/tp-libvirt#5234. |
virttest/migration.py
Outdated
if not wait_for_event_timeout: | ||
wait_for_event_timeout = '30' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you plz explain these 2 lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems equal with wait_for_event_timeout = one_func.get('wait_for_event_timeout', '30')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use the get() method of a dict object and return a default value if a specific key doesn't exist. If the key exists and it's None, it'll be returned.
For example,
one_func = {'before_pause': 'yes', 'need_sleep_time': '5', 'wait_for_event_timeout': None}
one_func.get('wait_for_event_timeout', '30')
one_func.get('non_exist', '30')
'30'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so will you merge these 2 lines to 'wait_for_event_timeout = one_func.get('wait_for_event_timeout')' to make it simple?
BTW, is this 'timeout' value paired with 'after_event'? If yes, can we highlight 'after_event' in it's name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated, thanks.
7f22176
to
25b6c13
Compare
25b6c13
to
2790829
Compare
b347565
to
a03b41a
Compare
It takes longer to get the desired event in copy storage migration. So update event timeout. Signed-off-by: lcheng <[email protected]>
a03b41a
to
e400b0c
Compare
It takes longer to get the desired event in copy storage migration. So update event timeout.