summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2012-02-01 17:51:41 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2012-02-02 17:08:12 +0000
commitd60343f25c2fa949e8c0108e89b915c228e23654 (patch)
tree586bccd56368e9af44038271ce41330009f54fc5
parent7f8d540689172bfd697e6d22775a94cc73259a3f (diff)
downloadtelepathy-glib-d60343f25c2fa949e8c0108e89b915c228e23654.tar.gz
channel-request test: avoid a race condition
If we emit Succeeded or Failed quickly enough after setting up the TpProxy, the match rules might not have reached the dbus-daemon yet. (The real ChannelRequest implementation avoids this bug by having the Proceed method.) Reviewed-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
-rw-r--r--tests/dbus/channel-request.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/dbus/channel-request.c b/tests/dbus/channel-request.c
index a56eccad8..6c75836f3 100644
--- a/tests/dbus/channel-request.c
+++ b/tests/dbus/channel-request.c
@@ -250,6 +250,9 @@ test_succeeded (Test *test,
g_signal_connect (test->cr, "succeeded-with-channel",
G_CALLBACK (succeeded_with_channel_cb), test);
+ /* sync up both sockets to ensure that the match rules are in place */
+ tp_tests_proxy_run_until_dbus_queue_processed (test->cr);
+
props = g_hash_table_new (NULL, NULL);
tp_svc_channel_request_emit_succeeded_with_channel (test->cr_service,
@@ -288,6 +291,9 @@ test_failed (Test *test,
g_signal_connect_swapped (test->cr, "succeeded", G_CALLBACK (succeeded_cb),
test);
+ /* sync up both sockets to ensure that the match rules are in place */
+ tp_tests_proxy_run_until_dbus_queue_processed (test->cr);
+
tp_svc_channel_request_emit_failed (test->cr_service,
TP_ERROR_STR_NOT_YOURS, "lalala");