From 2d89f8426753442b56696267da39169da0b6dc8b Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 14 Mar 2023 11:49:16 +0000 Subject: [PATCH] tests: Reduce number of iterations in queue test Unless `-m thorough` is passed to the tests, reduce the number of iterations in the random test. This one test case takes the bulk of the time to run the `queue` test suite, and is sometimes causing timeouts when running on CI (particularly under valgrind). Reduce it to a fifth. Signed-off-by: Philip Withnall --- glib/tests/queue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glib/tests/queue.c b/glib/tests/queue.c index 3b6c3580b..d916b0163 100644 --- a/glib/tests/queue.c +++ b/glib/tests/queue.c @@ -228,7 +228,7 @@ random_test (gconstpointer d) LINK_INDEX, UNLINK, DELETE_LINK, LAST_OP } QueueOp; -#define N_ITERATIONS 500000 + const guint n_iterations = g_test_thorough () ? 500000 : 100000; #define N_QUEUES 3 #define RANDOM_QUEUE() &(queues[g_random_int_range(0, N_QUEUES)]) @@ -256,7 +256,7 @@ random_test (gconstpointer d) queues[i].length = 0; } - for (i = 0; i < N_ITERATIONS; ++i) + for (i = 0; i < n_iterations; ++i) { int j; QueueInfo *qinf = RANDOM_QUEUE();