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@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@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@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@conf.localhost', 'bob'))
Sjoerd fixed this in a similar way.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.