Timer test flaky due to floating point precision
Submitted by Iain Lane
Link to original bug (#722604)
Description
[ I've lumped these into one bug but if you want them split out then I can do that ]
Several tests fail under `make check' and/or in Ubuntu's CI environment when running the installed-tests intermittently with 2.39.3, some more intermittently than others.
ERROR: asyncqueue
=================
GLib (gthread-posix.c): Unexpected error from C library during 'pthread_cond_timedwait': Invalid argument. Aborting.
Aborted
# random seed: R02Sfeecf2f8ab125750310ad438d8538d1d
# Start of asyncqueue tests
ok 1 /asyncqueue/sort
PASS: asyncqueue 1 /asyncqueue/sort
ok 2 /asyncqueue/destroy
PASS: asyncqueue 2 /asyncqueue/destroy
ok 3 /asyncqueue/threads
PASS: asyncqueue 3 /asyncqueue/threads
ERROR: asyncqueue - missing test plan
ERROR: asyncqueue - exited with status 134 (terminated by signal 6?)
ERROR: timer
============
**
GLib:ERROR:/build/buildd/glib2.0-2.39.3/./glib/tests/timer.c:38:test_timer_basic: assertion failed (micros == ((guint64)(elapsed * 1e6)) % 1000000): (1 == 0)
Aborted
# random seed: R02Sfaff4fa66d3b51cb8f6556638213c224
# Start of timer tests
# GLib:ERROR:/build/buildd/glib2.0-2.39.3/./glib/tests/timer.c:38:test_timer_basic: assertion failed (micros == ((guint64)(elapsed * 1e6)) % 1000000): (1 == 0)
ERROR: timer - missing test plan
ERROR: timer - exited with status 134 (terminated by signal 6?)
ERROR: timer
============
**
GLib:ERROR:/build/buildd/glib2.0-2.39.3/./glib/tests/timer.c:57:test_timer_stop: assertion failed (elapsed == elapsed2): (1e-06 == 1e-06)
Aborted
# random seed: R02S32481fbfbcf1cf268f33e22b0937e8a8
# Start of timer tests
# GLib:ERROR:/build/buildd/glib2.0-2.39.3/./glib/tests/timer.c:57:test_timer_stop: assertion failed (elapsed == elapsed2): (1e-06 == 1e-06)
ERROR: timer - missing test plan
ERROR: timer - exited with status 134 (terminated by signal 6?)
ERROR: gapplication
===================
(/build/buildd/glib2.0-2.39.3/debian/build/deb/gio/tests/.libs/lt-gapplication:381): GLib-GIO-ERROR **:
Expected
-----
got ./cmd 0
activate action1
change action2 1
exit status: 0
-----
Got (full)
-----
got ./cmd 0
change action2 1
activate action1
exit status: 0
-----
Trace/breakpoint trap
# random seed: R02S6ad0c8efa2d6cd27271e68464d7f4841
# Start of gapplication tests
ok 1 /gapplication/no-dbus
PASS: gapplication 1 /gapplication/no-dbus
ok 2 /gapplication/basic
PASS: gapplication 2 /gapplication/basic
ok 3 /gapplication/no-appid
PASS: gapplication 3 /gapplication/no-appid
ok 4 /gapplication/properties
PASS: gapplication 4 /gapplication/properties
ok 5 /gapplication/app-id
PASS: gapplication 5 /gapplication/app-id
ok 6 /gapplication/quit
PASS: gapplication 6 /gapplication/quit
ok 7 /gapplication/local-actions
PASS: gapplication 7 /gapplication/local-actions
# GLib-GIO-FATAL-ERROR:
Expected
-----
got ./cmd 0
activate action1
change action2 1
exit status: 0
-----
Got (full)
-----
got ./cmd 0
change action2 1
activate action1
exit status: 0
-----
cleaning up pid 451
ERROR: gapplication - missing test plan
ERROR: gapplication - exited with status 133 (terminated by signal 5?)
and also (from installed-tests)
# GLib-GIO-FATAL-ERROR:
Expected
-----
got ./cmd 0
got ./cmd 1
cmdline ./cmd echo --abc -d
environment TEST=1
getenv TEST=1
file /tmp/adt-run.QJFFc8/dsc0t-installed-tests-testtmp/tmpdir/test-tmp-glib_gapplication.test-ZJ8L9W/foo
properties ok
cwd /tmp/adt-run.QJFFc8/dsc0t-installed-tests-testtmp/tmpdir/test-tmp-glib_gapplication.test-ZJ8L9W
busy
idle
stdin ok
exit status: 0
-----
Got (full)
-----
got ./cmd 0
got ./cmd 1
cmdline ./cmd echo --abc -d
environment TEST=1
getenv TEST=1
file /tmp/adt-run.QJFFc8/dsc0t-installed-tests-testtmp/tmpdir/test-tmp-glib_gapplication.test-ZJ8L9W/foo
cwd /tmp/adt-run.QJFFc8/dsc0t-installed-tests-testtmp/tmpdir/test-tmp-glib_gapplication.test-ZJ8L9W
properties ok
busy
idle
stdin ok
exit status: 0
-----
Version: 2.39.x
Edited by Philip Withnall