Skip to content

Commit

Permalink
tests: collect more info on session startup timeout
Browse files Browse the repository at this point in the history
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 ee913ea)
  • Loading branch information
marmarek committed May 13, 2023
1 parent 39209bf commit 8416e4a
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions qubes/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand Down

0 comments on commit 8416e4a

Please sign in to comment.