[Telepathy-commits] [telepathy-gabble/master] When asserting on the absence of D-Bus signal, call synchronously a dummy D-Bus method to be sure to get the signal if any (avoid races)

Alban Crequy alban.crequy at collabora.co.uk
Tue Aug 19 10:52:43 PDT 2008


20080514145252-a41c0-2fb2288fd740c4b3f4918cf8e3ba5395c18677bd.gz
---
 tests/twisted/test-caps-hash.py |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/tests/twisted/test-caps-hash.py b/tests/twisted/test-caps-hash.py
index c1cb508..3689214 100644
--- a/tests/twisted/test-caps-hash.py
+++ b/tests/twisted/test-caps-hash.py
@@ -119,6 +119,9 @@ def _test(q, bus, conn, stream, contact, contact_handle, client):
     feature['var'] = 'http://jabber.org/protocol/bogus-feature'
     stream.send(result)
 
+    # Dummy synchronous D-Bus method call
+    assert conn.InspectHandles(1, []) == []
+
     # don't receive any D-Bus signal
     assert caps_changed_flag == 0
 
@@ -135,6 +138,9 @@ def _test(q, bus, conn, stream, contact, contact_handle, client):
     assert query_node.attributes['node'] == \
         client + '#' + '0.0'
 
+    # Dummy synchronous D-Bus method call
+    assert conn.InspectHandles(1, []) == []
+
     # still don't receive any D-Bus signal
     assert caps_changed_flag == 0
 
@@ -156,6 +162,8 @@ def _test(q, bus, conn, stream, contact, contact_handle, client):
     c['hash'] = 'sha-1'
     stream.send(presence)
 
+    # Dummy synchronous D-Bus method call
+    assert conn.InspectHandles(1, []) == []
     assert caps_changed_flag == 0
 
     # Gabble looks up our capabilities
@@ -197,6 +205,9 @@ def _test(q, bus, conn, stream, contact, contact_handle, client):
     """)
     stream.send(result)
 
+    # Dummy synchronous D-Bus method call
+    assert conn.InspectHandles(1, []) == []
+
     # we can now do audio calls
     assert caps_changed_flag == 0
     event = q.expect('dbus-signal', signal='CapabilitiesChanged')
-- 
1.5.6.3




More information about the Telepathy-commits mailing list