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

Increase sleep time in stress_mshv_vm_create test #3114

Merged
merged 1 commit into from
Dec 21, 2023
Merged

Increase sleep time in stress_mshv_vm_create test #3114

merged 1 commit into from
Dec 21, 2023

Conversation

pupacha
Copy link
Collaborator

@pupacha pupacha commented Dec 21, 2023

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.

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.
@pupacha pupacha merged commit b8abaac into main Dec 21, 2023
45 checks passed
@pupacha pupacha deleted the pavan/dev branch December 21, 2023 15:09
@@ -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
Copy link
Member

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.

Copy link
Collaborator Author

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.

Copy link
Member

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.

Copy link
Collaborator Author

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.

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.

3 participants