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 678959 - /mainloop/timeouts race condition: assertion failed (a == 10): (9 == 10)
/mainloop/timeouts race condition: assertion failed (a == 10): (9 == 10)
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: mainloop
2.33.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2012-06-27 09:44 UTC by Martin Pitt
Modified: 2012-06-27 13:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
/mainloop/timeouts test: Reduce race condition (1.00 KB, patch)
2012-06-27 09:48 UTC, Martin Pitt
committed Details | Review

Description Martin Pitt 2012-06-27 09:44:46 UTC
On the Debian builders, glib sometimes fails with

ERROR:/build/buildd-glib2.0_2.33.3-1-ia64-P3EWx7/glib2.0-2.33.3/./glib/tests/mainloop.c:182:test_timeouts: assertion failed (a == 10): (9 == 10)
  /mainloop/timeouts:                                                  FAIL

It seems that due to the load, particular traits of the architectures (I've seen it on ia64), or other circumstances, it only manages to call the "every 100 ms" timout 9 times in 1050 ms.
Comment 1 Martin Pitt 2012-06-27 09:48:21 UTC
Created attachment 217375 [details] [review]
/mainloop/timeouts test: Reduce race condition

This is an inherent race-condition in the test; allow it some slack and accept 9 times as well.
Comment 2 Dan Winship 2012-06-27 13:19:06 UTC
Comment on attachment 217375 [details] [review]
/mainloop/timeouts test: Reduce race condition


>-  g_assert_cmpint (a, ==, 10);
>+  g_assert_cmpint (a, >=, 9);
>+  g_assert_cmpint (a, <=, 10);

can you add a comment explaining that? ok to commit with that
Comment 3 Martin Pitt 2012-06-27 13:34:08 UTC
(In reply to comment #2)
> can you add a comment explaining that? ok to commit with that

Sure, committed with a comment:

http://git.gnome.org/browse/glib/commit/?id=95f29687e14423ca541cac1c00137375b935168d