[Bug 25257] New: race condition sometimes causes muc/test-muc-ownership.py to time out

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Nov 24 14:54:28 CET 2009


http://bugs.freedesktop.org/show_bug.cgi?id=25257

           Summary: race condition sometimes causes muc/test-muc-
                    ownership.py to time out
           Product: Telepathy
           Version: unspecified
          Platform: Other
               URL: http://git.collabora.co.uk/?p=user/smcv/telepathy-
                    gabble-smcv.git;a=shortlog;h=refs/heads/muc-test
        OS/Version: All
            Status: ASSIGNED
          Keywords: patch
          Severity: normal
          Priority: medium
         Component: gabble
        AssignedTo: simon.mcvittie at collabora.co.uk
        ReportedBy: simon.mcvittie at collabora.co.uk
         QAContact: telepathy-bugs at lists.freedesktop.org


I ran into this while forward-porting the fix for Bug #25243 to master, and
thought I should fix it while it was (briefly) reproducible...

commit 1dc0cee033d5d3eacc553fb8e891be152bc70cd7
Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   2009-11-24 13:51:21 +0000

    muc/test-muc-ownership.py: unrace a test

    If the second GroupFlagsChanged was processed before the stream-presence
    (relative order of D-Bus and stream events can't be guaranteed since
    they're on different sockets), then the test would time out.

diff --git a/tests/twisted/muc/test-muc-ownership.py
b/tests/twisted/muc/test-muc-ownership.py
index e2f9faf..1b48ee1 100644
--- a/tests/twisted/muc/test-muc-ownership.py
+++ b/tests/twisted/muc/test-muc-ownership.py
@@ -29,15 +29,15 @@ def test(q, bus, conn, stream):
     call_async(q, conn, 'RequestChannel', cs.CHANNEL_TYPE_TEXT, cs.HT_ROOM,
         room_handle, True)

-    gfc, _, _ = q.expect_many(
-        EventPattern('dbus-signal', signal='GroupFlagsChanged'),
+    q.expect_many(
+        EventPattern('dbus-signal', signal='GroupFlagsChanged',
+            predicate=lambda e: e.args[1] == 0),
         EventPattern('dbus-signal', signal='MembersChanged',
             args=[u'', [], [], [], [2], 0, 0]),
-        EventPattern('stream-presence', to='chat at conf.localhost/test'))
-    assert gfc.args[1] == 0
-
-    event = q.expect('dbus-signal', signal='GroupFlagsChanged')
-    assert event.args == [0, 1]
+        EventPattern('stream-presence', to='chat at conf.localhost/test'),
+        EventPattern('dbus-signal', signal='GroupFlagsChanged',
+            predicate=lambda e: e.args == [0, 1]),
+        )

     # Send presence for anonymous other member of room.
     stream.send(make_muc_presence('owner', 'moderator', 'chat at conf.localhost',
'bob'))


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.



More information about the telepathy-bugs mailing list