[glib: 2/5] tests: Remove an unnecessary timeout in gnotification test




commit 33f36af489b671d6fdc5e7a2dddea2216fe80652
Author: Philip Withnall <pwithnall endlessos org>
Date:   Wed Jun 1 15:20:38 2022 +0100

    tests: Remove an unnecessary timeout in gnotification test
    
    This is a fallback timeout to abort the test if the expected number of
    messages aren’t seen in time. However, when running the test under
    valgrind it will take longer and sometimes spuriously trigger the
    timeout.
    
    There’s no point in having an abort timeout inside the test: the test
    runner (Meson) already provides one for us, which we can adjust with a
    multiplier when running under valgrind.
    
    So removes the timeout from within the test. This should fix the
    gnotification test under valgrind.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>

 gio/tests/gnotification.c | 11 -----------
 1 file changed, 11 deletions(-)
---
diff --git a/gio/tests/gnotification.c b/gio/tests/gnotification.c
index b004f96780..2f7f36ee3c 100644
--- a/gio/tests/gnotification.c
+++ b/gio/tests/gnotification.c
@@ -136,16 +136,6 @@ server_notify_is_running (GObject    *object,
     }
 }
 
-static gboolean
-timeout (gpointer user_data)
-{
-  GNotificationServer *server = user_data;
-
-  g_notification_server_stop (server);
-
-  return G_SOURCE_REMOVE;
-}
-
 static void
 basic (void)
 {
@@ -162,7 +152,6 @@ basic (void)
   g_signal_connect (server, "notification-received", G_CALLBACK (notification_received), &received_count);
   g_signal_connect (server, "notification-removed", G_CALLBACK (notification_removed), &removed_count);
   g_signal_connect (server, "notify::is-running", G_CALLBACK (server_notify_is_running), loop);
-  g_timeout_add_seconds (1, timeout, server);
 
   g_main_loop_run (loop);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]