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 <pwithnall@endlessos.org>
This commit is contained in:
Philip Withnall 2023-03-14 11:49:16 +00:00
parent 1f6a4d60d4
commit 2d89f84267

View File

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