[telepathy-mission-control/master] crash-recovery/crash-recovery.py: don't fail if ObserveChannels comes in before the AM bus name appears

Simon McVittie simon.mcvittie at collabora.co.uk
Wed May 27 05:17:04 PDT 2009


This failure mode was observed while valgrinding MC.
---
 test/twisted/crash-recovery/crash-recovery.py |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/test/twisted/crash-recovery/crash-recovery.py b/test/twisted/crash-recovery/crash-recovery.py
index 8f308a7..76b367d 100644
--- a/test/twisted/crash-recovery/crash-recovery.py
+++ b/test/twisted/crash-recovery/crash-recovery.py
@@ -74,9 +74,10 @@ def test(q, bus, unused):
             handle=[text_fixed_properties], bypass_approval=False)
     client.handled_channels.append(handled_chan.object_path)
 
-    # service-activate MC
+    # Service-activate MC.
+    # We're told about the other channel as an observer...
     mc = make_mc(bus, q.append)
-    q.expect_many(
+    _, _, _, e = q.expect_many(
             EventPattern('dbus-signal',
                 path='/org/freedesktop/DBus',
                 interface='org.freedesktop.DBus', signal='NameOwnerChanged',
@@ -89,13 +90,12 @@ def test(q, bus, unused):
                 path='/org/freedesktop/DBus',
                 interface='org.freedesktop.DBus', signal='NameOwnerChanged',
                 predicate=lambda e: e.args[0] == cs.MC and e.args[2]),
+            EventPattern('dbus-method-call',
+                path=client.object_path,
+                interface=cs.OBSERVER, method='ObserveChannels',
+                handled=False),
             )
 
-    # we're told about the other channel as an observer...
-    e = q.expect('dbus-method-call',
-            path=client.object_path,
-            interface=cs.OBSERVER, method='ObserveChannels',
-            handled=False)
     assert e.args[1] == conn.object_path, e.args
     channels = e.args[2]
     assert channels[0][0] == unhandled_chan.object_path, channels
-- 
1.5.6.5




More information about the telepathy-commits mailing list