From d60343f25c2fa949e8c0108e89b915c228e23654 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 1 Feb 2012 17:51:41 +0000 Subject: 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 --- tests/dbus/channel-request.c | 6 ++++++ 1 file changed, 6 insertions(+) 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"); -- cgit v1.2.1