From 3f3f07dc3510f9fcacc85bec2fbf146c3a19970e Mon Sep 17 00:00:00 2001 From: Ben Grande Date: Fri, 31 Jul 2026 16:56:59 +0200 Subject: [PATCH] Respect qrexec_timeout over hardcoded value Tests have been failing due to short timeout. The qubesteststub has increased "shutdown_timeout" and "qrexec_timeout" to 120s, let's use that. Fixes: https://github.com/QubesOS/qubes-issues/issues/11025 --- qubes/tests/integ/dispvm.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/qubes/tests/integ/dispvm.py b/qubes/tests/integ/dispvm.py index 22ae9ff5c..6e9d80604 100644 --- a/qubes/tests/integ/dispvm.py +++ b/qubes/tests/integ/dispvm.py @@ -436,7 +436,7 @@ def wait_for_dispvm_destroy(self, dispvm_names): self.fail("didn't destroy dispvm(s) in time") logger.info("end") - async def run_preload_proc(self): + async def run_preload_proc(self, timeout=60): logger.info("start") proc = await asyncio.create_subprocess_exec( *self.preload_cmd, @@ -444,7 +444,9 @@ async def run_preload_proc(self): stdin=asyncio.subprocess.DEVNULL, ) try: - stdout, _ = await asyncio.wait_for(proc.communicate(), timeout=60) + stdout, _ = await asyncio.wait_for( + proc.communicate(), timeout=timeout + ) return stdout.decode() except asyncio.TimeoutError: proc.terminate() @@ -464,7 +466,7 @@ async def run_preload(self, assert_stdout: bool = True): self._test_event_handler_remove(appvm, "domain-preload-dispvm-start") self._test_event_handler_remove(dispvm, "domain-unpaused") - stdout = await self.run_preload_proc() + stdout = await self.run_preload_proc(timeout=appvm.qrexec_timeout) if assert_stdout: self.assertEqual(stdout, dispvm_name) test_cases = [ @@ -1165,7 +1167,10 @@ async def _test_015_preload_race_more(self): self.disp_base.features["preload-dispvm-max"] = str(preload_max) await self.wait_preload(preload_max) old_preload = self.disp_base.get_feat_preload() - tasks = [self.run_preload_proc() for _ in range(preload_max)] + tasks = [ + self.run_preload_proc(timeout=self.disp_base.qrexec_timeout) + for _ in range(preload_max) + ] targets = await asyncio.gather(*tasks) await self.wait_preload(preload_max) preload_dispvm = self.disp_base.get_feat_preload() @@ -1183,7 +1188,10 @@ async def _test_016_preload_race_less(self): preload_max = 1 self.disp_base.features["preload-dispvm-max"] = str(preload_max) await self.wait_preload(preload_max, wait_completion=False) - tasks = [self.run_preload_proc(), self.no_preload()] + tasks = [ + self.run_preload_proc(timeout=self.disp_base.qrexec_timeout), + self.no_preload(), + ] target = await asyncio.gather(*tasks) target_dispvm = target[0] self.assertTrue(target_dispvm.startswith("disp"))