Skip to content
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

Merged
merged 1 commit into from
Dec 7, 2023

Conversation

cliping
Copy link
Contributor

@cliping cliping commented Oct 30, 2023

It takes longer to get the desired event in copy storage migration. So update event timeout.

@cliping
Copy link
Contributor Author

cliping commented Oct 30, 2023

Test result in autotest/tp-libvirt#5234.

Comment on lines 416 to 417
if not wait_for_event_timeout:
wait_for_event_timeout = '30'
Copy link
Contributor

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?

Copy link
Contributor

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')

Copy link
Contributor Author

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'

Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, thanks.

@cliping cliping requested a review from Yingshun December 4, 2023 10:46
@cliping cliping force-pushed the update-timeout branch 2 times, most recently from b347565 to a03b41a Compare December 6, 2023 04:07
It takes longer to get the desired event in copy storage migration.
So update event timeout.

Signed-off-by: lcheng <[email protected]>
@chloerh chloerh merged commit 7fd19b5 into avocado-framework:master Dec 7, 2023
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants