mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 15:36:17 +01:00
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.
This commit is contained in:
parent
e9ec1ad068
commit
e0f4b2b03b
@ -1064,21 +1064,25 @@ test_dns (gpointer fixture,
|
|||||||
uri = g_strdup_printf ("beta://no-such-host.xx:%u", server.server_port);
|
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);
|
conn = g_socket_client_connect_to_uri (client, uri, 0, NULL, &error);
|
||||||
g_assert_no_error (error);
|
g_assert_no_error (error);
|
||||||
g_clear_object (&conn);
|
|
||||||
|
|
||||||
g_assert_no_error (proxy_a.last_error);
|
g_assert_no_error (proxy_a.last_error);
|
||||||
g_assert_no_error (proxy_b.last_error);
|
g_assert_no_error (proxy_b.last_error);
|
||||||
|
|
||||||
|
do_echo_test (conn);
|
||||||
|
g_clear_object (&conn);
|
||||||
teardown_test (NULL, NULL);
|
teardown_test (NULL, NULL);
|
||||||
|
|
||||||
g_socket_client_connect_to_uri_async (client, uri, 0, NULL,
|
g_socket_client_connect_to_uri_async (client, uri, 0, NULL,
|
||||||
async_got_conn, &conn);
|
async_got_conn, &conn);
|
||||||
while (conn == NULL)
|
while (conn == NULL)
|
||||||
g_main_context_iteration (NULL, TRUE);
|
g_main_context_iteration (NULL, TRUE);
|
||||||
g_clear_object (&conn);
|
|
||||||
g_free (uri);
|
g_free (uri);
|
||||||
|
|
||||||
g_assert_no_error (proxy_a.last_error);
|
g_assert_no_error (proxy_a.last_error);
|
||||||
g_assert_no_error (proxy_b.last_error);
|
g_assert_no_error (proxy_b.last_error);
|
||||||
|
|
||||||
|
do_echo_test (conn);
|
||||||
|
g_clear_object (&conn);
|
||||||
teardown_test (NULL, NULL);
|
teardown_test (NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user