mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
tests: Replace common integration sleeps with polling
Use polling helpers in common integration tests instead of fixed sleeps where the tests already know the expected ready state. This updates CPU and memory hotplug checks as well as a few device- and restore-related waits in common_parallel to stop oversleeping on the fast path while keeping the same assertions. On-behalf-of: SAP philipp.schuster@sap.com Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
This commit is contained in:
committed by
Rob Bradford
parent
2c395d4ae8
commit
47024e73ce
@@ -1439,19 +1439,25 @@ impl Guest {
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
pub fn check_nvidia_gpu(&self) {
|
||||
pub fn check_nvidia_gpu(&self) -> bool {
|
||||
let output = self.ssh_command("nvidia-smi").unwrap();
|
||||
if !output.contains("NVIDIA L40S") {
|
||||
let dmesg = self
|
||||
.ssh_command("sudo dmesg")
|
||||
.unwrap_or_else(|e| format!("Failed to get dmesg: {e:?}"));
|
||||
eprintln!(
|
||||
"\n\n==== Guest dmesg (nvidia-smi check failed) ====\n\n\
|
||||
{dmesg}\n\
|
||||
\n==== End guest dmesg ====\n\n"
|
||||
);
|
||||
panic!("nvidia-smi output did not contain 'NVIDIA L40S': {output}");
|
||||
|
||||
if output.contains("NVIDIA L40S") {
|
||||
return true;
|
||||
}
|
||||
|
||||
let dmesg = self
|
||||
.ssh_command("sudo dmesg")
|
||||
.unwrap_or_else(|e| format!("Failed to get dmesg: {e:?}"));
|
||||
|
||||
eprintln!(
|
||||
"\n\n==== Guest dmesg (nvidia-smi check failed) ====\n\n\
|
||||
{dmesg}\n\
|
||||
\n==== End guest dmesg ====\n\n"
|
||||
);
|
||||
eprintln!("nvidia-smi output did not contain 'NVIDIA L40S': {output}");
|
||||
|
||||
false
|
||||
}
|
||||
|
||||
pub fn reboot_linux(&self, current_reboot_count: u32) {
|
||||
|
||||
Reference in New Issue
Block a user