From e8db16fde7bd71fb57d93395a430c5509e7838ef Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Thu, 27 Sep 2012 11:22:56 +0200 Subject: [PATCH] Disable some tests on slow architectures which keep failing the tests [smcv: Modified to use g_test_skip() instead of omitting those test cases completely, and allow them to be re-enabled with a Debian-specific environment variable] Co-authored-by: Simon McVittie Forwarded: no --- glib/tests/mainloop.c | 16 ++++++++++++++++ glib/tests/timeout.c | 9 +++++++++ gobject/tests/threadtests.c | 8 ++++++++ 3 files changed, 33 insertions(+) diff --git a/glib/tests/mainloop.c b/glib/tests/mainloop.c index c18da94..2aec6ff 100644 --- a/glib/tests/mainloop.c +++ b/glib/tests/mainloop.c @@ -520,6 +520,14 @@ test_child_sources (void) GMainLoop *loop; GSource *parent, *child_b, *child_c, *end; +#if defined(__arm__) + if (g_getenv ("DEB_ALLOW_FLAKY_TESTS") == NULL) + { + g_test_skip ("Not reliable on older ARM hardware"); + return; + } +#endif + ctx = g_main_context_new (); loop = g_main_loop_new (ctx, FALSE); @@ -598,6 +606,14 @@ test_recursive_child_sources (void) GMainLoop *loop; GSource *parent, *child_b, *child_c, *end; +#if defined(__arm__) + if (g_getenv ("DEB_ALLOW_FLAKY_TESTS") == NULL) + { + g_test_skip ("Not reliable on older ARM hardware"); + return; + } +#endif + ctx = g_main_context_new (); loop = g_main_loop_new (ctx, FALSE); diff --git a/glib/tests/timeout.c b/glib/tests/timeout.c index acbb8f3..60cc5f2 100644 --- a/glib/tests/timeout.c +++ b/glib/tests/timeout.c @@ -177,6 +177,15 @@ test_func (gpointer data) static void test_rounding (void) { + +#if defined(__arm__) + if (g_getenv ("DEB_ALLOW_FLAKY_TESTS") == NULL) + { + g_test_skip ("Not reliable on older ARM hardware"); + return; + } +#endif + loop = g_main_loop_new (NULL, FALSE); last_time = g_get_monotonic_time (); diff --git a/gobject/tests/threadtests.c b/gobject/tests/threadtests.c index 3b485eb..6ea9a48 100644 --- a/gobject/tests/threadtests.c +++ b/gobject/tests/threadtests.c @@ -484,6 +484,14 @@ test_threaded_toggle_notify (void) "safely from another (the main) thread without causing the " "notifying thread to abort"); +#if defined(__arm__) + if (g_getenv ("DEB_ALLOW_FLAKY_TESTS") == NULL) + { + g_test_skip ("Intermittently takes more than 5 minutes on 32-bit ARM (Debian#1023652)"); + return; + } +#endif + g_object_add_toggle_ref (object, on_toggle_notify, &data); g_object_unref (object);