[Telepathy-commits] [telepathy-gabble/master] Fix test race between stream and dbus event.

Will Thompson will.thompson at collabora.co.uk
Mon Mar 2 08:09:58 PST 2009


Reviewed-by: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
---
 tests/twisted/tubes/offer-private-dbus-tube.py |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/tests/twisted/tubes/offer-private-dbus-tube.py b/tests/twisted/tubes/offer-private-dbus-tube.py
index e89f2c4..ab01558 100644
--- a/tests/twisted/tubes/offer-private-dbus-tube.py
+++ b/tests/twisted/tubes/offer-private-dbus-tube.py
@@ -306,12 +306,15 @@ def test(q, bus, conn, stream, bytestream_cls):
     presence = make_presence('alice at localhost/Test', 'test at localhost', caps)
     stream.send(presence)
 
-    q.expect('dbus-signal', signal='PresencesChanged',
-        args = [{alice_handle: (2L, u'available', u'')}])
+    _, disco_event = q.expect_many(
+        EventPattern('dbus-signal', signal='PresencesChanged',
+            args = [{alice_handle: (2L, u'available', u'')}]),
+        EventPattern('stream-iq', to='alice at localhost/Test',
+            query_ns=ns.DISCO_INFO),
+        )
 
     # reply to disco query
-    event = q.expect('stream-iq', to='alice at localhost/Test', query_ns=ns.DISCO_INFO)
-    stream.send(make_caps_disco_reply(stream, event.stanza, [ns.TUBES]))
+    stream.send(make_caps_disco_reply(stream, disco_event.stanza, [ns.TUBES]))
 
     sync_stream(q, stream)
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list