From 8416e4a85a8f73b7c20e10d13cfd38ef4349913a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Fri, 14 Apr 2023 01:56:47 +0200 Subject: [PATCH] tests: collect more info on session startup timeout At least some of those are caused by gui-agent startup failures, like this one: qubes-gui[621]: XOpenDisplay: Success systemd[1]: qubes-gui-agent.service: Main process exited, code=exited, status=1/FAILURE systemd[1]: qubes-gui-agent.service: Failed with result 'exit-code'. Unfortunately no more details are logged and the VM is destroyed shortly after. Try to collect more info before removing it. (cherry picked from commit ee913eaeb2ebfeb5f0c321b15b510b79f1666371) --- qubes/tests/__init__.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/qubes/tests/__init__.py b/qubes/tests/__init__.py index a6c0a527f..68d97c0e5 100644 --- a/qubes/tests/__init__.py +++ b/qubes/tests/__init__.py @@ -1344,10 +1344,17 @@ async def wait_for_session(self, vm): # first boot of whonix-ws takes more time because of /home # initialization, including Tor Browser copying timeout = 120 - await asyncio.wait_for( - vm.run_service_for_stdio( - 'qubes.WaitForSession', input=vm.default_user.encode()), - timeout=timeout) + try: + await asyncio.wait_for( + vm.run_service_for_stdio( + 'qubes.WaitForSession', input=vm.default_user.encode()), + timeout=timeout) + except asyncio.TimeoutError: + # collect some more info + stdout, _ = await vm.run_for_stdio('cat .xsession-errors') + self.log.error("VM {} xsession-errors on timeout: {}".format( + vm.name, stdout.decode())) + raise async def start_vm(self, vm): """Start a VM and wait for it to be fully up"""