summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2020-02-25 10:45:07 +0000
committerSimon McVittie <smcv@debian.org>2024-03-24 13:47:15 +0000
commit91a7ef14aa1a17b8cd24f1d8a4c94b80e7393010 (patch)
tree3e895695bcc80a473c585e2d625fbee2febfeb0c
parent3fdb059be6ecec279f7c40b2f537d1b5ca56d14d (diff)
testfilemonitor: Skip if we are avoiding flaky tests
See https://gitlab.gnome.org/GNOME/glib/issues/1634 Signed-off-by: Simon McVittie <smcv@debian.org> Forwarded: no Gbp-Pq: Topic debian Gbp-Pq: Name testfilemonitor-Skip-if-we-are-avoiding-flaky-tests.patch
-rw-r--r--gio/tests/testfilemonitor.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/gio/tests/testfilemonitor.c b/gio/tests/testfilemonitor.c
index 52a530244..99c1dd0fc 100644
--- a/gio/tests/testfilemonitor.c
+++ b/gio/tests/testfilemonitor.c
@@ -32,6 +32,12 @@ setup (Fixture *fixture,
gchar *path = NULL;
GError *local_error = NULL;
+ if (g_getenv ("DEB_ALLOW_FLAKY_TESTS") == NULL)
+ {
+ g_test_skip ("https://gitlab.gnome.org/GNOME/glib/issues/1634");
+ return;
+ }
+
path = g_dir_make_tmp ("gio-test-testfilemonitor_XXXXXX", &local_error);
g_assert_no_error (local_error);
@@ -48,7 +54,9 @@ teardown (Fixture *fixture,
{
GError *local_error = NULL;
- g_file_delete (fixture->tmp_dir, NULL, &local_error);
+ if (fixture->tmp_dir != NULL)
+ g_file_delete (fixture->tmp_dir, NULL, &local_error);
+
g_assert_no_error (local_error);
g_clear_object (&fixture->tmp_dir);
}
@@ -375,6 +383,10 @@ test_atomic_replace (Fixture *fixture,
if (skip_win32 ())
return;
+ /* respect g_test_skip() during setup() */
+ if (g_test_failed ())
+ return;
+
data.step = 0;
data.events = NULL;
@@ -483,6 +495,10 @@ test_file_changes (Fixture *fixture,
if (skip_win32 ())
return;
+ /* respect g_test_skip() during setup() */
+ if (g_test_failed ())
+ return;
+
data.step = 0;
data.events = NULL;
@@ -603,6 +619,10 @@ test_dir_monitor (Fixture *fixture,
if (skip_win32 ())
return;
+ /* respect g_test_skip() during setup() */
+ if (g_test_failed ())
+ return;
+
data.step = 0;
data.events = NULL;
@@ -703,6 +723,10 @@ test_dir_non_existent (Fixture *fixture,
if (skip_win32 ())
return;
+ /* respect g_test_skip() during setup() */
+ if (g_test_failed ())
+ return;
+
data.step = 0;
data.events = NULL;
@@ -815,6 +839,10 @@ test_cross_dir_moves (Fixture *fixture,
if (skip_win32 ())
return;
+ /* respect g_test_skip() during setup() */
+ if (g_test_failed ())
+ return;
+
data[0].step = 0;
data[0].events = NULL;
@@ -984,6 +1012,10 @@ test_file_hard_links (Fixture *fixture,
GError *error = NULL;
TestData data;
+ /* respect g_test_skip() during setup() */
+ if (g_test_failed ())
+ return;
+
g_test_bug ("https://bugzilla.gnome.org/show_bug.cgi?id=755721");
if (skip_win32 ())
@@ -1043,6 +1075,10 @@ test_finalize_in_callback (Fixture *fixture,
GFile *file = NULL;
guint i;
+ /* respect g_test_skip() during setup() */
+ if (g_test_failed ())
+ return;
+
g_test_summary ("Test that finalization of a GFileMonitor in one of its "
"callbacks doesn’t cause a deadlock.");
g_test_bug ("https://gitlab.gnome.org/GNOME/glib/-/issues/1941");