tests: Remove unnecessary subprocess from dataset tests

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 <pwithnall@gnome.org>
This commit is contained in:
Philip Withnall 2024-03-22 00:35:05 +00:00
parent afcb839121
commit 1df5759db9

View File

@ -192,20 +192,12 @@ 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 ();
}
static void