[glib: 1/2] tests: Be more lenient with timing checks on asyncqueue pops
- From: Sebastian Dröge <sdroege src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 1/2] tests: Be more lenient with timing checks on asyncqueue pops
- Date: Sun, 13 Dec 2020 09:18:22 +0000 (UTC)
commit c58f308aed4574b2ea48453db5102fc2e5b5a89c
Author: Philip Withnall <pwithnall endlessos org>
Date: Fri Dec 11 16:41:26 2020 +0000
tests: Be more lenient with timing checks on asyncqueue pops
On heavily loaded CI machines it seems to be taking about 1.3s between
one `g_get_monotonic_time()` call and the next. Allow that.
Signed-off-by: Philip Withnall <pwithnall endlessos org>
glib/tests/asyncqueue.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/glib/tests/asyncqueue.c b/glib/tests/asyncqueue.c
index 2c6abf1b7..c414e69c1 100644
--- a/glib/tests/asyncqueue.c
+++ b/glib/tests/asyncqueue.c
@@ -193,7 +193,7 @@ test_async_queue_timed (void)
/* diff should be only a little bit more than G_USEC_PER_SEC/10, but
* we have to leave some wiggle room for heavily-loaded machines...
*/
- g_assert_cmpint (diff, <, G_USEC_PER_SEC);
+ g_assert_cmpint (diff, <, 2 * G_USEC_PER_SEC);
start = end;
g_get_current_time (&tv);
@@ -204,7 +204,7 @@ test_async_queue_timed (void)
end = g_get_monotonic_time ();
diff = end - start;
g_assert_cmpint (diff, >=, G_USEC_PER_SEC / 10);
- g_assert_cmpint (diff, <, G_USEC_PER_SEC);
+ g_assert_cmpint (diff, <, 2 * G_USEC_PER_SEC);
start = end;
g_get_current_time (&tv);
@@ -217,7 +217,7 @@ test_async_queue_timed (void)
end = g_get_monotonic_time ();
diff = end - start;
g_assert_cmpint (diff, >=, G_USEC_PER_SEC / 10);
- g_assert_cmpint (diff, <, G_USEC_PER_SEC);
+ g_assert_cmpint (diff, <, 2 * G_USEC_PER_SEC);
g_async_queue_unref (q);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]