[Telepathy-commits] [telepathy-gabble/master] muc/roomlist.py: remove race condition from beginning of test

Simon McVittie simon.mcvittie at collabora.co.uk
Thu Aug 21 05:46:06 PDT 2008


If the disco#items IQ on the TCP socket won the race with StatusChanged
on the D-Bus socket, then the test would fail.
---
 tests/twisted/muc/roomlist.py |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/tests/twisted/muc/roomlist.py b/tests/twisted/muc/roomlist.py
index 2439bba..2ce1e38 100644
--- a/tests/twisted/muc/roomlist.py
+++ b/tests/twisted/muc/roomlist.py
@@ -13,10 +13,12 @@ from servicetest import call_async, lazy, match, EventPattern
 def test(q, bus, conn, stream):
     conn.Connect()
 
-    q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+    _, event = q.expect_many(
+            EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+            EventPattern('stream-iq', to='localhost',
+                query_ns='http://jabber.org/protocol/disco#items'),
+            )
 
-    event = q.expect('stream-iq', to='localhost',
-        query_ns='http://jabber.org/protocol/disco#items')
     result = make_result_iq(stream, event.stanza)
     item = result.firstChildElement().addElement('item')
     item['jid'] = 'conf.localhost'
-- 
1.5.6.3



More information about the Telepathy-commits mailing list