[gnome-settings-daemon/benzea/update-ci-template: 2/2] color: Use real time during test for timerfd



commit 38396447caf326e8c696361a4d13430babd0b931
Author: Benjamin Berg <bberg redhat com>
Date:   Mon May 25 16:38:43 2020 +0200

    color: Use real time during test for timerfd
    
    Otherwise we have a loop that just burns CPU for 5 seconds in the CI
    test, and it tends to log >50k lines which are useless.

 plugins/color/gsd-night-light.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/plugins/color/gsd-night-light.c b/plugins/color/gsd-night-light.c
index b5a55bc0..635f1608 100644
--- a/plugins/color/gsd-night-light.c
+++ b/plugins/color/gsd-night-light.c
@@ -423,7 +423,9 @@ poll_timeout_create (GsdNightLight *self)
         if (self->source != NULL)
                 return;
 
-        dt_now = gsd_night_light_get_date_time_now (self);
+        /* It is not a good idea to make this overridable, it just creates
+         * an infinite loop as a fixed date for testing just doesn't work. */
+        dt_now = g_date_time_new_now_local ();
         dt_expiry = g_date_time_add_seconds (dt_now, GSD_NIGHT_LIGHT_POLL_TIMEOUT);
         self->source = _gnome_datetime_source_new (dt_now,
                                                    dt_expiry,


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