From 4a68477e5e501dc5e5932e1326e36fe964cce940 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 29 Oct 2013 13:38:20 +0000 Subject: [PATCH 49/49] account-manager/avatar.py: fix race condition by combining expect_many calls The test account-storage plugin uses GDBus, so its signals have an undefined order with respect to MC's dbus-glib signals. We don't actually care about the order anyway, so expect them all in one big expect_many call. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71001 Reviewed-by: Guillaume Desmottes --- tests/twisted/account-manager/avatar.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/twisted/account-manager/avatar.py b/tests/twisted/account-manager/avatar.py index 8bae300..b31ab97 100644 --- a/tests/twisted/account-manager/avatar.py +++ b/tests/twisted/account-manager/avatar.py @@ -162,10 +162,8 @@ def test(q, bus, mc): interface=cs.TEST_DBUS_ACCOUNT_PLUGIN_IFACE, signal='DeferringSetAttribute', args=[account.object_path, 'AvatarMime', '']), - ) - q.expect('dbus-signal', path=account.object_path, - interface=cs.ACCOUNT_IFACE_AVATAR, signal='AvatarChanged') - q.expect_many( + EventPattern('dbus-signal', path=account.object_path, + interface=cs.ACCOUNT_IFACE_AVATAR, signal='AvatarChanged'), EventPattern('dbus-signal', interface=cs.TEST_DBUS_ACCOUNT_PLUGIN_IFACE, signal='CommittingOne', -- 1.8.3.1