After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 725668 - test_GDateTime_now_utc is timing-sensitive
test_GDateTime_now_utc is timing-sensitive
Status: RESOLVED DUPLICATE of bug 749080
Product: glib
Classification: Platform
Component: general
2.39.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2014-03-04 17:25 UTC by Iain Lane
Modified: 2015-09-14 10:32 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Iain Lane 2014-03-04 17:25:30 UTC
I guess you have to get pretty unlucky to hit this

# GLib:ERROR:/«PKGBUILDDIR»/./glib/tests/gdatetime.c:674:test_GDateTime_now_utc: assertion failed (tm.tm_sec == g_date_time_get_second (dt)): (37 == 38)

static void
test_GDateTime_now_utc (void)
{
  GDateTime *dt;
  time_t     t;
  struct tm  tm;

  t = time (NULL);
  gmtime_r (&t, &tm);
  /* … */
  /* Here we get interrupted long enough for the second to tick over */
  dt = g_date_time_new_now_utc ();
  /* … */
  g_assert_cmpint (tm.tm_sec, ==, g_date_time_get_second (dt));
  g_date_time_unref (dt);
}
Comment 1 Iain Lane 2015-09-14 10:32:11 UTC

*** This bug has been marked as a duplicate of bug 749080 ***