From 3027486cb5476c846e6595213e86e8baf011f77a Mon Sep 17 00:00:00 2001 From: Ben Grande Date: Mon, 15 Dec 2025 13:31:25 +0100 Subject: [PATCH] Respect shutdown_timeout property on tests For: https://github.com/QubesOS/openqa-tests-qubesos/pull/49 For: https://github.com/QubesOS/qubes-issues/issues/1512 --- qubes/tests/__init__.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/qubes/tests/__init__.py b/qubes/tests/__init__.py index db69003e3..4430d6654 100644 --- a/qubes/tests/__init__.py +++ b/qubes/tests/__init__.py @@ -1404,7 +1404,9 @@ def enter_keys_in_window(self, title, keys): ] + keys subprocess.check_call(command) - def shutdown_and_wait(self, vm, timeout=60): + def shutdown_and_wait(self, vm, timeout=0): + if not timeout: + timeout = vm.shutdown_timeout try: self.loop.run_until_complete( vm.shutdown(wait=True, timeout=timeout) @@ -1414,8 +1416,10 @@ def shutdown_and_wait(self, vm, timeout=60): del vm self.fail("Timeout while waiting for VM {} shutdown".format(name)) - def shutdown_paused(self, vm, timeout=60): + def shutdown_paused(self, vm, timeout=0): self.loop.run_until_complete(vm.pause()) + if not timeout: + timeout = vm.shutdown_timeout with self.assertRaises(qubes.exc.QubesVMNotRunningError): self.loop.run_until_complete( vm.shutdown(wait=True, timeout=timeout, force=False) @@ -1644,7 +1648,7 @@ async def wait_for_session(self, vm): if getattr(vm, "template", None) and "whonix-w" in vm.template.name: # first boot of whonix-ws takes more time because of /home # initialization, including Tor Browser copying - timeout = 120 + timeout = vm.qrexec_timeout try: await asyncio.wait_for( vm.run_service_for_stdio(