summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2011-09-22 18:13:45 +0100
committerWill Thompson <will.thompson@collabora.co.uk>2011-09-28 11:32:19 +0100
commit90fb7c9e5f8d81b669d4a01c1a9ec1886170b965 (patch)
treeb3a195f630f29665557cb2a1b3496df5c2f724ac /tests
parent95a3fdd9a18b638d3e20df0df5976c2bf41c150d (diff)
mctest: resuscitate MC asynchronously
Shortly, MC will start making blocking calls on the test suite's fake NM implementation (via nm-glib). Calling bus.get_object service-activated MC as a side-effect of making a blocking call to Introspect() on it, so it deadlocked. I think it's clearer to explicitly, asynchronously activate it, and wait for it to claim its names; which also avoids the deadlock.
Diffstat (limited to 'tests')
-rw-r--r--tests/twisted/mctest.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/twisted/mctest.py b/tests/twisted/mctest.py
index 72d3db66..68f01087 100644
--- a/tests/twisted/mctest.py
+++ b/tests/twisted/mctest.py
@@ -1111,13 +1111,14 @@ def tell_mc_to_die(q, bus):
def resuscitate_mc(q, bus, mc):
"""Having killed MC with tell_mc_to_die(), this function revives it."""
- bus.get_object(cs.MC, "/")
+ # We kick the daemon asynchronously because nm-glib makes blocking calls
+ # back to us during initialization...
+ bus.call_async(dbus.BUS_DAEMON_NAME, dbus.BUS_DAEMON_PATH,
+ dbus.BUS_DAEMON_IFACE, 'StartServiceByName', 'su', (cs.MC, 0),
+ reply_handler=None, error_handler=None)
# Wait until it's up
- q.expect('dbus-signal', signal='NameOwnerChanged',
- predicate=(lambda e:
- e.args[0] == 'org.freedesktop.Telepathy.AccountManager' and
- e.args[2] != ''))
+ mc.wait_for_names()
return connect_to_mc(q, bus, mc)