Skip to content

Commit

Permalink
tests/conftest.py: Error out if xdp exited before exporting its bus
Browse files Browse the repository at this point in the history
Otherwise we'll be stuck in the loop forever and it's not clear what's
going on.
  • Loading branch information
swick authored and GeorgesStavracas committed Jan 10, 2025
1 parent 34ff12c commit 9c53c92
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,11 @@ def xdg_desktop_portal(
xdg_desktop_portal = subprocess.Popen([xdg_desktop_portal_path], env=env)

while not dbus_con.name_has_owner("org.freedesktop.portal.Desktop"):
returncode = xdg_desktop_portal.poll()
if returncode is not None:
raise subprocess.SubprocessError(
f"xdg-desktop-portal exited with {returncode}"
)
time.sleep(0.1)

yield xdg_desktop_portal
Expand All @@ -501,6 +506,11 @@ def xdg_permission_store(
permission_store = subprocess.Popen([xdg_permission_store_path], env=env)

while not dbus_con.name_has_owner("org.freedesktop.impl.portal.PermissionStore"):
returncode = permission_store.poll()
if returncode is not None:
raise subprocess.SubprocessError(
f"xdg-permission-store exited with {returncode}"
)
time.sleep(0.1)

yield permission_store
Expand Down Expand Up @@ -530,6 +540,11 @@ def xdg_document_portal(
document_portal = subprocess.Popen([xdg_document_portal_path], env=env)

while not dbus_con.name_has_owner("org.freedesktop.portal.Documents"):
returncode = document_portal.poll()
if returncode is not None:
raise subprocess.SubprocessError(
f"xdg-document-portal exited with {returncode}"
)
time.sleep(0.1)

yield document_portal
Expand Down

0 comments on commit 9c53c92

Please sign in to comment.