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);