[glib] gio/tests/proxy-test: fix cleanup



commit e0f4b2b03b877e0360f56836ebfe454aa3a9dca5
Author: Dan Winship <danw gnome org>
Date:   Thu Jun 21 15:13:06 2012 -0400

    gio/tests/proxy-test: fix cleanup
    
    make sure the proxy threads are in the "waiting for a connection"
    state when we do the final cleanup, or else there are race conditions
    involving which thread processes the GCancellable cancellation first.

 gio/tests/proxy-test.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gio/tests/proxy-test.c b/gio/tests/proxy-test.c
index 0527608..24c27e0 100644
--- a/gio/tests/proxy-test.c
+++ b/gio/tests/proxy-test.c
@@ -1064,21 +1064,25 @@ test_dns (gpointer fixture,
   uri = g_strdup_printf ("beta://no-such-host.xx:%u", server.server_port);
   conn = g_socket_client_connect_to_uri (client, uri, 0, NULL, &error);
   g_assert_no_error (error);
-  g_clear_object (&conn);
 
   g_assert_no_error (proxy_a.last_error);
   g_assert_no_error (proxy_b.last_error);
+
+  do_echo_test (conn);
+  g_clear_object (&conn);
   teardown_test (NULL, NULL);
 
   g_socket_client_connect_to_uri_async (client, uri, 0, NULL,
 					async_got_conn, &conn);
   while (conn == NULL)
     g_main_context_iteration (NULL, TRUE);
-  g_clear_object (&conn);
   g_free (uri);
 
   g_assert_no_error (proxy_a.last_error);
   g_assert_no_error (proxy_b.last_error);
+
+  do_echo_test (conn);
+  g_clear_object (&conn);
   teardown_test (NULL, NULL);
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]