From ad6907fb078472f3d77262d3c32f28a6dcc887af Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Fri, 6 Sep 2024 10:28:24 +0100 Subject: [PATCH] util/tests: Reduce load from sparse-array test Only create 8 threads rather than 16, since otherwise that can hammer fork a bit too much. Since it creates a bunch of threads, don't try to run it in parallel with other tests either. Signed-off-by: Daniel Stone Part-of: --- src/util/meson.build | 1 + src/util/tests/sparse_array_test.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util/meson.build b/src/util/meson.build index 8008c986bfc..832890784cf 100644 --- a/src/util/meson.build +++ b/src/util/meson.build @@ -409,6 +409,7 @@ if with_tests ), suite : ['util'], protocol : 'gtest', + is_parallel : false, timeout : 180, ) diff --git a/src/util/tests/sparse_array_test.cpp b/src/util/tests/sparse_array_test.cpp index eeca8d35f9e..d9b43862764 100644 --- a/src/util/tests/sparse_array_test.cpp +++ b/src/util/tests/sparse_array_test.cpp @@ -53,7 +53,7 @@ TEST(SparseArrayTest, Multithread) struct util_sparse_array arr; util_sparse_array_init(&arr, sizeof(uint32_t), node_size); - thrd_t threads[16]; + thrd_t threads[8]; for (unsigned i = 0; i < ARRAY_SIZE(threads); i++) { int ret = thrd_create(&threads[i], test_thread, &arr); ASSERT_EQ(ret, thrd_success);