r46705 - in /desktop/unstable/glib2.0/debian: changelog patches/0001-GDateTime-test-fix-occasional-failures.patch patches/series
laney at users.alioth.debian.org
laney at users.alioth.debian.org
Thu Oct 15 15:07:39 UTC 2015
Author: laney
Date: Thu Oct 15 15:07:39 2015
New Revision: 46705
URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=46705
Log:
debian/patches/0001-GDateTime-test-fix-occasional-failures.patch: Take
patch from bgo#754994 to resolve intermittent test failures in the
GDateTime tests.
Added:
desktop/unstable/glib2.0/debian/patches/0001-GDateTime-test-fix-occasional-failures.patch
Modified:
desktop/unstable/glib2.0/debian/changelog
desktop/unstable/glib2.0/debian/patches/series
Modified: desktop/unstable/glib2.0/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/glib2.0/debian/changelog?rev=46705&op=diff
==============================================================================
--- desktop/unstable/glib2.0/debian/changelog [utf-8] (original)
+++ desktop/unstable/glib2.0/debian/changelog [utf-8] Thu Oct 15 15:07:39 2015
@@ -20,6 +20,9 @@
#1497170)
* debian/patches/0001-Revert-list-store-Fix-a-parameter-check.patch: Drop -
this is applied upstream in this release.
+ * debian/patches/0001-GDateTime-test-fix-occasional-failures.patch: Take
+ patch from bgo#754994 to resolve intermittent test failures in the
+ GDateTime tests.
-- Michael Biebl <biebl at debian.org> Thu, 08 Oct 2015 19:14:31 +0200
Added: desktop/unstable/glib2.0/debian/patches/0001-GDateTime-test-fix-occasional-failures.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/glib2.0/debian/patches/0001-GDateTime-test-fix-occasional-failures.patch?rev=46705&op=file
==============================================================================
--- desktop/unstable/glib2.0/debian/patches/0001-GDateTime-test-fix-occasional-failures.patch (added)
+++ desktop/unstable/glib2.0/debian/patches/0001-GDateTime-test-fix-occasional-failures.patch [utf-8] Thu Oct 15 15:07:39 2015
@@ -0,0 +1,96 @@
+From 3d07f27e92089ebcc622a1fbc1224d345fffb18a Mon Sep 17 00:00:00 2001
+From: Ryan Lortie <desrt at desrt.ca>
+Date: Thu, 15 Oct 2015 15:14:36 +0100
+Subject: [PATCH] GDateTime test: fix occasional failures
+
+We were using the time() library call to get the current time from the
+system in order to compare it to the time returned by
+g_date_time_new_now().
+
+Of course, we took care to ensure that the time (in seconds) didn't
+change in the middle of this process by checking the before and after
+value of the system time.
+
+Unfortunately, the system time as measured by time() was being taken
+from a less-accurate clock source than the time used by GDateTime. As a
+result, we could have GDateTime already into the next second while the
+"seconds" value of the time returned by time() was still in the last
+one, even when checked "after".
+
+Avoid the problem by using the same ultimate source for time --
+g_get_real_time().
+
+This is based on a similar patch from Iain Lane, but it uses
+g_get_real_time() instead of g_get_current_time().
+
+https://bugzilla.gnome.org/show_bug.cgi?id=754994
+---
+ glib/tests/gdatetime.c | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/glib/tests/gdatetime.c b/glib/tests/gdatetime.c
+index 967cc05..16a163c 100644
+--- a/glib/tests/gdatetime.c
++++ b/glib/tests/gdatetime.c
+@@ -79,14 +79,14 @@ test_GDateTime_now (void)
+ * to guard against that. */
+ do
+ {
+- before = time (NULL);
++ before = g_get_real_time () / G_TIME_SPAN_SECOND;
+
+ memset (&tm, 0, sizeof (tm));
+ get_localtime_tm (before, &tm);
+
+ dt = g_date_time_new_now_local ();
+
+- after = time (NULL);
++ after = g_get_real_time () / G_TIME_SPAN_SECOND;
+ }
+ while (before != after);
+
+@@ -672,7 +672,7 @@ test_GDateTime_now_utc (void)
+ * to guard against that. */
+ do
+ {
+- t = time (NULL);
++ t = g_get_real_time () / G_TIME_SPAN_SECOND;
+ #ifdef HAVE_GMTIME_R
+ gmtime_r (&t, &tm);
+ #else
+@@ -687,7 +687,7 @@ test_GDateTime_now_utc (void)
+ #endif
+ dt = g_date_time_new_now_utc ();
+
+- after = time (NULL);
++ after = g_get_real_time () / G_TIME_SPAN_SECOND;
+ }
+ while (t != after);
+
+@@ -733,7 +733,7 @@ test_GDateTime_get_utc_offset (void)
+ struct tm tm;
+
+ memset (&tm, 0, sizeof (tm));
+- get_localtime_tm (time (NULL), &tm);
++ get_localtime_tm (g_get_real_time () / G_TIME_SPAN_SECOND, &tm);
+
+ dt = g_date_time_new_now_local ();
+ ts = g_date_time_get_utc_offset (dt);
+@@ -776,12 +776,12 @@ test_GDateTime_to_local (void)
+ * to guard against that. */
+ do
+ {
+- before = time (NULL);
++ before = g_get_real_time () / G_TIME_SPAN_SECOND;
+ g_clear_pointer (&utc, g_date_time_unref);
+ g_clear_pointer (&now, g_date_time_unref);
+ utc = g_date_time_new_now_utc ();
+ now = g_date_time_new_now_local ();
+- after = time (NULL);
++ after = g_get_real_time () / G_TIME_SPAN_SECOND;
+ }
+ while (before != after);
+
+--
+2.5.0
+
Modified: desktop/unstable/glib2.0/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/glib2.0/debian/patches/series?rev=46705&op=diff
==============================================================================
--- desktop/unstable/glib2.0/debian/patches/series [utf-8] (original)
+++ desktop/unstable/glib2.0/debian/patches/series [utf-8] Thu Oct 15 15:07:39 2015
@@ -12,3 +12,4 @@
0001-timer-test-use-volatile-for-locals.patch
skip-broken-timer-test.patch
0001-Fix-trashing-on-overlayfs.patch
+0001-GDateTime-test-fix-occasional-failures.patch
More information about the pkg-gnome-commits
mailing list