From ecaa5b5b7abcf7b15d5ff7e2672b8bd1314541a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Tue, 12 Jul 2022 17:18:52 +0200 Subject: [PATCH] gio/tests/desktop-app-info: Wait until the callback is called The test was flacky because we were only relying on the presence of a file, while the callback could have not been called yet, while ensure for both assumptions to be true before stop iterating the loop. --- gio/tests/desktop-app-info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gio/tests/desktop-app-info.c b/gio/tests/desktop-app-info.c index 2bcdba7cf..6d3f4e853 100644 --- a/gio/tests/desktop-app-info.c +++ b/gio/tests/desktop-app-info.c @@ -1118,7 +1118,7 @@ test_default_uri_handler_async (void) on_launch_default_for_uri_success_cb, &called); - while (!g_file_test (file_path, G_FILE_TEST_IS_REGULAR)) + while (!g_file_test (file_path, G_FILE_TEST_IS_REGULAR) || !called) g_main_context_iteration (NULL, FALSE); g_assert_true (called);