[Telepathy-commits] [telepathy-gabble/master] Fix race condition in roster/ensure.py (fd.o #18404)

Simon McVittie simon.mcvittie at collabora.co.uk
Thu Nov 6 03:12:22 PST 2008


---
 tests/twisted/roster/ensure.py |   14 +++-----------
 1 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/tests/twisted/roster/ensure.py b/tests/twisted/roster/ensure.py
index fa1b507..44dfd61 100644
--- a/tests/twisted/roster/ensure.py
+++ b/tests/twisted/roster/ensure.py
@@ -43,14 +43,9 @@ def test(q, bus, conn, stream):
     ret = q.expect('dbus-return', method='EnsureChannel')
     ret2 = q.expect('dbus-return', method='EnsureChannel')
 
-    while True:
-        sig = q.expect('dbus-signal', signal='NewChannels')
-        sig_path, sig_props = sig.args[0][0]
-        if sig_props['org.freedesktop.Telepathy.Channel.TargetHandleType'] ==\
-            HT_GROUP and\
-           sig_props['org.freedesktop.Telepathy.Channel.TargetHandle'] ==\
-            test_handle:
-            break
+    # We don't test the NewChannels signal here - depending on exact timing,
+    # it might happen between the two EnsureChannel calls, or after the second
+    # one.
 
     yours, path, props = ret.value
     yours2, path2, props2 = ret2.value
@@ -68,8 +63,5 @@ def test(q, bus, conn, stream):
     assert path == path2, (path, path2)
     assert props == props2, (props, props2)
 
-    assert sig_props == props, (sig_props, props)
-
-
 if __name__ == '__main__':
     exec_test(test)
-- 
1.5.6.5



More information about the Telepathy-commits mailing list