diff --git a/glib/tests/mainloop.c b/glib/tests/mainloop.c index 7d61d7a79..7e27b3c67 100644 --- a/glib/tests/mainloop.c +++ b/glib/tests/mainloop.c @@ -193,12 +193,16 @@ test_timeouts (void) g_main_loop_run (loop); - /* this is a race condition; under some circumstances we might not get 10 - * 100ms runs in 1050 ms, so consider 9 as "close enough" */ - g_assert_cmpint (a, >=, 9); + /* We may be delayed for an arbitrary amount of time - for example, + * it's possible for all timeouts to fire exactly once. + */ + g_assert_cmpint (a, >, 0); + g_assert_cmpint (a, >=, b); + g_assert_cmpint (b, >=, c); + g_assert_cmpint (a, <=, 10); - g_assert_cmpint (b, ==, 4); - g_assert_cmpint (c, ==, 3); + g_assert_cmpint (b, <=, 4); + g_assert_cmpint (c, <=, 3); g_main_loop_unref (loop); g_main_context_unref (ctx);