Commit eaa70c6c by Patrick Steinhardt

tests: object: decrease number of concurrent cache accesses

In our test case object::cache::fast_thread_rush, we're creating 100
concurrent threads opening a repository and reading objects from it.
This test actually fails on ARM32 with an out-of-memory error, which
isn't entirely unexpected.

Work around the issue by halving the number of threads.
parent 01a83406
...@@ -244,15 +244,15 @@ static void *cache_quick(void *arg) ...@@ -244,15 +244,15 @@ static void *cache_quick(void *arg)
void test_object_cache__fast_thread_rush(void) void test_object_cache__fast_thread_rush(void)
{ {
int try, th, data[THREADCOUNT*2]; int try, th, data[THREADCOUNT];
#ifdef GIT_THREADS #ifdef GIT_THREADS
git_thread t[THREADCOUNT*2]; git_thread t[THREADCOUNT];
#endif #endif
for (try = 0; try < REPEAT; ++try) { for (try = 0; try < REPEAT; ++try) {
cl_git_pass(git_repository_open(&g_repo, cl_fixture("testrepo.git"))); cl_git_pass(git_repository_open(&g_repo, cl_fixture("testrepo.git")));
for (th = 0; th < THREADCOUNT*2; ++th) { for (th = 0; th < THREADCOUNT; ++th) {
data[th] = th; data[th] = th;
#ifdef GIT_THREADS #ifdef GIT_THREADS
cl_git_pass( cl_git_pass(
...@@ -263,7 +263,7 @@ void test_object_cache__fast_thread_rush(void) ...@@ -263,7 +263,7 @@ void test_object_cache__fast_thread_rush(void)
} }
#ifdef GIT_THREADS #ifdef GIT_THREADS
for (th = 0; th < THREADCOUNT*2; ++th) { for (th = 0; th < THREADCOUNT; ++th) {
void *rval; void *rval;
cl_git_pass(git_thread_join(&t[th], &rval)); cl_git_pass(git_thread_join(&t[th], &rval));
cl_assert_equal_i(th, *((int *)rval)); cl_assert_equal_i(th, *((int *)rval));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment