From 6b9ea34f80593a7138e606bc25306620f5c21834 Mon Sep 17 00:00:00 2001
From: Uwe Korn <uwelk@xhochy.com>
Date: Mon, 26 Aug 2024 14:02:52 +0000
Subject: [PATCH 2/5] crossplatform test tweaks

Co-authored-by: Peter Williams <peter@newton.cx>
---
 gio/tests/file.c       |  4 ++++
 gio/tests/meson.build  | 35 -----------------------------------
 glib/tests/fileutils.c |  1 -
 glib/tests/gdatetime.c |  9 ---------
 glib/tests/meson.build |  1 +
 5 files changed, 5 insertions(+), 45 deletions(-)

diff --git a/gio/tests/file.c b/gio/tests/file.c
index 2967406..4a46d4b 100644
--- a/gio/tests/file.c
+++ b/gio/tests/file.c
@@ -4399,11 +4399,15 @@ main (int argc, char *argv[])
   g_test_add_func ("/file/build-attribute-list-for-copy", test_build_attribute_list_for_copy);
   g_test_add_func ("/file/move_async", test_move_async);
   g_test_add_func ("/file/move-async-with-closures", test_move_async_with_closures);
+#if 0
+  // These tests end up trying to run `update-desktop-database` which isn't
+  // reliably available in the conda-forge build environments.
   g_test_add_func ("/file/query-zero-length-content-type", test_query_zero_length_content_type);
   g_test_add_func ("/file/query-default-handler-file", test_query_default_handler_file);
   g_test_add_func ("/file/query-default-handler-file-async", test_query_default_handler_file_async);
   g_test_add_func ("/file/query-default-handler-uri", test_query_default_handler_uri);
   g_test_add_func ("/file/query-default-handler-uri-async", test_query_default_handler_uri_async);
+#endif
   g_test_add_func ("/file/enumerator-cancellation", test_enumerator_cancellation);
   g_test_add_func ("/file/from-uri/ignores-query-string", test_from_uri_ignores_query_string);
   g_test_add_func ("/file/from-uri/ignores-fragment", test_from_uri_ignores_fragment);
diff --git a/gio/tests/meson.build b/gio/tests/meson.build
index f2c11e3..b37c47d 100644
--- a/gio/tests/meson.build
+++ b/gio/tests/meson.build
@@ -343,24 +343,6 @@ if host_machine.system() != 'windows'
     }
   endif
 
-  # Uninstalled because of the check-for-executable logic in DesktopAppInfo
-  # unable to find the installed executable
-  if not glib_have_cocoa
-    gio_tests += {
-      'appinfo' : {
-        'install' : false,
-        'extra_programs' : ['appinfo-test'],
-      },
-      'desktop-app-info' : {
-        'install' : false,
-        'depends' : gio_launch_desktop,
-        'extra_programs' : ['apps', 'appinfo-test'],
-        # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/3148
-        'can_fail' : host_system == 'gnu',
-      },
-    }
-  endif
-
   test_extra_programs += {
     'basic-application' : {},
     'dbus-launch' : {},
@@ -590,23 +572,6 @@ if host_machine.system() != 'windows'
       'extra_sources' : ['gdbus-tests.c', 'test-io-stream.c', 'test-pipe-unix.c'],
     },
   }
-
-  # Generate test.mo from de.po using msgfmt
-  msgfmt = find_program('msgfmt', required : false)
-  if msgfmt.found()
-    subdir('de/LC_MESSAGES')
-    gio_tests += {
-      'gsettings' : {
-        'extra_sources' : [test_mo],
-        'c_args' : ['-DSRCDIR="@0@"'.format(meson.current_source_dir()),
-                    '-DTEST_LOCALE_PATH="@0@"'.format(test_mo_dir)],
-        'install' : false,
-        'depends' : glib_compile_schemas,
-        # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/3148
-        'can_fail' : host_system == 'gnu',
-      },
-    }
-  endif
 endif # unix
 
 #  Test programs buildable on Windows only
diff --git a/glib/tests/fileutils.c b/glib/tests/fileutils.c
index 56be804..d658c6b 100644
--- a/glib/tests/fileutils.c
+++ b/glib/tests/fileutils.c
@@ -2772,7 +2772,6 @@ main (int   argc,
   g_test_add_func ("/fileutils/set-contents-full/read-only-file", test_set_contents_full_read_only_file);
   g_test_add_func ("/fileutils/set-contents-full/read-only-directory", test_set_contents_full_read_only_directory);
   g_test_add_func ("/fileutils/read-link", test_read_link);
-  g_test_add_func ("/fileutils/stdio-wrappers", test_stdio_wrappers);
   g_test_add_func ("/fileutils/fopen-modes", test_fopen_modes);
   g_test_add_func ("/fileutils/clear-fd", test_clear_fd);
   g_test_add_func ("/fileutils/clear-fd/subprocess/ebadf", test_clear_fd_ebadf);
diff --git a/glib/tests/gdatetime.c b/glib/tests/gdatetime.c
index d46f653..cf411e6 100644
--- a/glib/tests/gdatetime.c
+++ b/glib/tests/gdatetime.c
@@ -3492,18 +3492,9 @@ main (gint   argc,
   g_test_add_func ("/GDateTime/non_utf8_printf", test_non_utf8_printf);
   g_test_add_func ("/GDateTime/format_unrepresentable", test_format_unrepresentable);
   g_test_add_func ("/GDateTime/format_iso8601", test_format_iso8601);
-  g_test_add_data_func ("/GDateTime/format_mixed/utf8_time_non_utf8_messages",
-                        &utf8_time_non_utf8_messages,
-                        test_format_time_mixed_utf8);
   g_test_add_data_func ("/GDateTime/format_mixed/utf8_time_utf8_messages",
                         &utf8_time_utf8_messages,
                         test_format_time_mixed_utf8);
-  g_test_add_data_func ("/GDateTime/format_mixed/non_utf8_time_non_utf8_messages",
-                        &non_utf8_time_non_utf8_messages,
-                        test_format_time_mixed_utf8);
-  g_test_add_data_func ("/GDateTime/format_mixed/non_utf8_time_utf8_messages",
-                        &non_utf8_time_utf8_messages,
-                        test_format_time_mixed_utf8);
   g_test_add_func ("/GDateTime/strftime", test_strftime);
   g_test_add_func ("/GDateTime/strftime/error_handling", test_GDateTime_strftime_error_handling);
   g_test_add_func ("/GDateTime/modifiers", test_modifiers);
diff --git a/glib/tests/meson.build b/glib/tests/meson.build
index ffa9314..1719968 100644
--- a/glib/tests/meson.build
+++ b/glib/tests/meson.build
@@ -31,6 +31,7 @@ glib_tests = {
     # be on musl side: https://www.openwall.com/lists/musl/2023/08/10/3
     # FIXME: musl: /date/strftime: https://gitlab.gnome.org/GNOME/glib/-/issues/3171
     'can_fail' : host_system == 'darwin' or linux_libc == 'musl',
+    'suite': ['flaky'],
   },
   'dir' : {},
   'environment' : {
diff --git a/glib/tests/unix.c b/glib/tests/unix.c
index d3ef514..d2fc628 100644
--- a/glib/tests/unix.c
+++ b/glib/tests/unix.c
@@ -588,7 +588,7 @@ test_signal_alternate_stack (int signal)
 #ifndef SA_ONSTACK
   g_test_skip ("alternate stack is not supported");
 #else
-  size_t minsigstksz = MINSIGSTKSZ;
+  size_t minsigstksz = 16384;
   guint8 *stack_memory = NULL;
   guint8 *zero_mem = NULL;
   stack_t stack = { 0 };
