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-01 17:57:13 +0000
commit4718016b803e7b2927c6b9fe74714f028d8aa5f4 (patch)
tree8f526bd7296c6e9464f7f212f0f1e88d6eb3f421
parentcdfa979d03137d90150ac030a21c92f1f6e5e60b (diff)
downloadtelepathy-glib-4718016b803e7b2927c6b9fe74714f028d8aa5f4.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 fe6887d1c..884c35aa7 100644
--- a/tests/dbus/channel-request.c
+++ b/tests/dbus/channel-request.c
@@ -248,6 +248,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,
@@ -286,6 +289,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");