From 1df5759db9b34b5d6736c1d1aa7765506f0e0fe7 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Fri, 22 Mar 2024 00:35:05 +0000 Subject: [PATCH] tests: Remove unnecessary subprocess from dataset tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The dataset tests are using a subprocess to catch possible deadlocks within the `test_datalist_clear()` test. However, that’s causing occasional spurious test failures on the slower CI runners, where the subprocess can take longer than 500ms to run due to the machine being overloaded. Remove the subprocess from the test, and allow the test to deadlock if it fails. The Meson test harness has a timeout for catching things like this. Signed-off-by: Philip Withnall --- glib/tests/dataset.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/glib/tests/dataset.c b/glib/tests/dataset.c index 8c479857a..11c876e7d 100644 --- a/glib/tests/dataset.c +++ b/glib/tests/dataset.c @@ -193,19 +193,11 @@ free_one (gpointer data) static void test_datalist_clear (void) { - /* Need to use a subprocess because it will deadlock if it fails */ - if (g_test_subprocess ()) - { - g_datalist_init (&global_list); - g_datalist_set_data_full (&global_list, "one", GINT_TO_POINTER (1), free_one); - g_datalist_set_data_full (&global_list, "two", GINT_TO_POINTER (2), NULL); - g_datalist_clear (&global_list); - g_assert (global_list == NULL); - return; - } - - g_test_trap_subprocess (NULL, 500000, G_TEST_SUBPROCESS_DEFAULT); - g_test_trap_assert_passed (); + g_datalist_init (&global_list); + g_datalist_set_data_full (&global_list, "one", GINT_TO_POINTER (1), free_one); + g_datalist_set_data_full (&global_list, "two", GINT_TO_POINTER (2), NULL); + g_datalist_clear (&global_list); + g_assert (global_list == NULL); } static void