[telepathy-mission-control/master] dispatcher/handle-channels-fails.py: remove a race by asserting that fd.o #21003 exists

Simon McVittie simon.mcvittie at collabora.co.uk
Tue Jun 23 09:55:07 PDT 2009


The order of events isn't guaranteed, unfortunately, and valgrind makes MC
slow enough that we lose the race and fail the test. This is yet another
test that will have to be changed when fd.o #21003 is finally fixed.
---
 test/twisted/dispatcher/handle-channels-fails.py |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/test/twisted/dispatcher/handle-channels-fails.py b/test/twisted/dispatcher/handle-channels-fails.py
index 139d8a3..d8d9ea7 100644
--- a/test/twisted/dispatcher/handle-channels-fails.py
+++ b/test/twisted/dispatcher/handle-channels-fails.py
@@ -116,17 +116,22 @@ def test(q, bus, mc):
             cs.tp_name_prefix + '.Client.Empathy')
 
     # Empathy is asked to handle the channels
-    e = q.expect('dbus-method-call',
-            path=empathy.object_path,
-            interface=cs.HANDLER, method='HandleChannels',
-            handled=False)
+    e, _, _, _ = q.expect_many(
+            EventPattern('dbus-method-call',
+                path=empathy.object_path,
+                interface=cs.HANDLER, method='HandleChannels',
+                handled=False),
+            # FIXME: currently HandleWith succeeds immediately, rather than
+            # failing when HandleChannels fails (fd.o #21003)
+            EventPattern('dbus-return', method='HandleWith'),
+            EventPattern('dbus-signal', interface=cs.CDO, signal='Finished'),
+            EventPattern('dbus-signal', interface=cs.CD_IFACE_OP_LIST,
+                signal='DispatchOperationFinished'),
+            )
 
     # Empathy rejects the channels
     q.dbus_raise(e.message, cs.NOT_AVAILABLE, 'Blind drunk', bus=empathy_bus)
 
-    # FIXME: currently HandleWith succeeds
-    q.expect('dbus-return', method='HandleWith')
-
     # Now there are no more active channel dispatch operations
     assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == []
 
-- 
1.5.6.5



More information about the telepathy-commits mailing list