summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBenjamin Berg <bberg@redhat.com>2021-07-20 17:45:20 +0200
committerBenjamin Berg <bberg@redhat.com>2021-07-22 14:24:10 +0200
commite81e1b5dcb46001b3a7ac8a6d20d1a597adfb870 (patch)
tree3533d574690b12b360d382c0702ca8d7e688cdc3 /tests
parent468fab7461431b5c4d45c1778d8db40040bf1427 (diff)
downloadgnome-settings-daemon-e81e1b5dcb46001b3a7ac8a6d20d1a597adfb870.tar.gz
tests: Use OutputChecker for notification daemon
Using a pipe without guaranteeing that it is actually read could potentially get us into really weird deadlock situations. Switch to use OutputChecker to avoid the issue (and log the notifications).
Diffstat (limited to 'tests')
-rw-r--r--tests/gsdtestcase.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/gsdtestcase.py b/tests/gsdtestcase.py
index e0704128..a45e5125 100644
--- a/tests/gsdtestcase.py
+++ b/tests/gsdtestcase.py
@@ -94,10 +94,11 @@ class GSDTestCase(X11SessionTestCase):
klass.addClassCleanup(klass.session_bus_con.close)
# we never want to cause notifications on the actual GUI
+ klass.p_notify_log = OutputChecker()
klass.p_notify = klass.spawn_server_template(
- 'notification_daemon', {}, stdout=subprocess.PIPE)[0]
- set_nonblock(klass.p_notify.stdout)
- klass.addClassCleanup(lambda : (klass.p_notify.terminate(), klass.p_notify.wait()))
+ 'notification_daemon', {}, stdout=klass.p_notify_log.fd)[0]
+ klass.p_notify_log.writer_attached()
+ klass.addClassCleanup(klass.stop_process, klass.p_notify)
klass.start_session()
klass.start_monitor()