From ebfbd9c56affcc14e5907bd81e53ef3311c1dc31 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 22 Nov 2022 16:11:49 +0000 Subject: [PATCH] tests: Remove a manual timeout from desktop-app-info test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It sometimes fails under valgrind, and is pointless: if the test is wedged, it’s better to catch that with the timeout at the level of `meson test`, which can be tailored (using `-t`) to the test environment and wrapper. See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2961#note_1600072 Signed-off-by: Philip Withnall --- gio/tests/desktop-app-info.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/gio/tests/desktop-app-info.c b/gio/tests/desktop-app-info.c index fef88d224..e8f122d04 100644 --- a/gio/tests/desktop-app-info.c +++ b/gio/tests/desktop-app-info.c @@ -582,20 +582,8 @@ wait_for_file (const gchar *want_this, const gchar *but_not_this, const gchar *or_this) { - guint retries = 600; - - /* I hate time-based conditions in tests, but this will wait up to one - * whole minute for "touch file" to finish running. I think it should - * be OK. - * - * 600 * 100ms = 60 seconds. - */ while (access (want_this, F_OK) != 0) - { - g_usleep (100000); /* 100ms */ - g_assert_cmpuint (retries, >, 0); - retries--; - } + g_usleep (100000); /* 100ms */ g_assert_cmpuint (access (but_not_this, F_OK), !=, 0); g_assert_cmpuint (access (or_this, F_OK), !=, 0);