-
Notifications
You must be signed in to change notification settings - Fork 172
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
Increase sleep time in stress_mshv_vm_create test #3114
Conversation
CVM guest takes longer time to boot. 20 seconds is the empirical boot time for a guest with 1G memory. Also, CVM guest process killing takes slightly longer time. Hence, increase the sleep timeout accordingly.
@@ -186,7 +186,8 @@ def _mshv_stress_vm_create( | |||
sleep_time = 10 | |||
if guest_vm_type == "CVM": | |||
# CVM guest take little more time to boot | |||
sleep_time = 100 | |||
# 20 seconds per VM (with default 1024M) | |||
sleep_time = 20 * vm_count |
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.
Sleep is not a right fix. It needs to find a way to detect the state with an interval/timeout pattern.
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.
That is done intentionally. We want to launch multiple Cloud-hypervisor processes (VMs) but this is asynchronous and there is no straightforward way to determine if guest finished booting. sleep
is easiest way to wait until guest boots.
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.
The "sleep" looks the easiest way, but it causes problems a lot. Either a longer time, or wait the long time for all cases. If others copy your solution, the problem is worse. To wait a VM started, you can use wait_tcp_port_ready
method. The reboot
tool use who
or uptime
to check last boot time to check if reboot happened.
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.
The VMs we launch, here from this testcase, are without any networking support, so there's no way to check network readiness. Also, sleep
is only for a special vm type i.e, CVM
and this has to be given as an explicit input testcase variable. By default, testcase does wait for long time.
I agree that there has to be a better way to check if VM finished its botting. If in future, cloud-hypervisor tool is used more and scenarios like these comes up more, we will plan to implement VM readiness checks.
CVM guest takes longer time to boot. 20 seconds is the empirical boot time for a guest with 1G memory. Also, CVM guest process killing takes slightly longer time. Hence, increase the sleep timeout accordingly.