From 30850eef22b6053ce0455e175918dacd97ff8a2b Mon Sep 17 00:00:00 2001 From: Qubasa Date: Wed, 14 Feb 2024 15:40:03 +0700 Subject: [PATCH] clan_cli: Added longer timeout for test --- pkgs/clan-cli/tests/test_vms_cli.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/clan-cli/tests/test_vms_cli.py b/pkgs/clan-cli/tests/test_vms_cli.py index 2a137bfad..e0e7a70ea 100644 --- a/pkgs/clan-cli/tests/test_vms_cli.py +++ b/pkgs/clan-cli/tests/test_vms_cli.py @@ -40,7 +40,7 @@ def run_vm_in_thread(machine_name: str) -> None: # wait for qmp socket to exist def wait_vm_up(state_dir: Path) -> None: socket_file = state_dir / "qga.sock" - timeout = 5.0 + timeout: float = 300 while True: if timeout <= 0: raise TimeoutError(f"qga socket {socket_file} not found") @@ -53,8 +53,12 @@ def wait_vm_up(state_dir: Path) -> None: # wait for vm to be down by checking if qga socket is down def wait_vm_down(state_dir: Path) -> None: socket_file = state_dir / "qga.sock" + timeout: float = 300 while socket_file.exists(): + if timeout <= 0: + raise TimeoutError(f"qga socket {socket_file} still exists") sleep(0.1) + timeout -= 0.1 # wait for vm to be up then connect and return qmp instance