tests: GThreadPool free-function is not reliably called on FreeBSD yet

This new feature in 2.69.0 does not appear to be reliable on the FreeBSD
CI runners. Disable this part of the test while it's investigated,
so that we can use CI as an acceptance gate for unrelated branches again.

Leave it enabled when run with `-m thorough` so that FreeBSD developers
can debug the intermittent failure.

Mitigates: https://gitlab.gnome.org/GNOME/glib/-/issues/2456
Signed-off-by: Simon McVittie <smcv@collabora.com>
diff --git a/glib/tests/thread-pool.c b/glib/tests/thread-pool.c
index 50a72a6..b497b9a 100644
--- a/glib/tests/thread-pool.c
+++ b/glib/tests/thread-pool.c
@@ -194,6 +194,16 @@
   g_assert_true (success);
 
   g_thread_pool_free (pool, TRUE, TRUE);
+
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+  if (!free_func_called && !g_test_thorough ())
+    {
+      g_test_incomplete ("GThreadPool free-function not called - "
+                         "https://gitlab.gnome.org/GNOME/glib/-/issues/2456");
+      return;
+    }
+#endif
+
   g_assert_true (free_func_called);
 }