p0004: don't error out if test repo is too small

Repositories with less than 4000 entries are always handled using a single thread, causing test-lazy-init-name-hash --multi to error out. Don't abort the whole test script in that case, but simply skip the multi-threaded performance check. We can still use it to compare the single-threaded speed of different versions in that case. Signed-off-by: Rene Scharfe <l.s.r@web.de> Acked-by: Jeff Hostetler <git@jeffhostetler.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

René Scharfe committed May 13, 2017 at 18:03 UTC c5a915739386a59e00c95632801f43d4740a64aa
1 file changed +8 -5
t/perf/p0004-lazy-init-name-hash.sh
+8 -5
@@ -8,10 +8,13 @@ test_checkout_worktree
8
9 test_expect_success 'verify both methods build the same hashmaps' '
10 test-lazy-init-name-hash --dump --single >out.single &&
11 - test-lazy-init-name-hash --dump --multi >out.multi &&
12 - sort <out.single >sorted.single &&
13 - sort <out.multi >sorted.multi &&
14 - test_cmp sorted.single sorted.multi
11 + if test-lazy-init-name-hash --dump --multi >out.multi
12 + then
13 + test_set_prereq REPO_BIG_ENOUGH_FOR_MULTI &&
14 + sort <out.single >sorted.single &&
15 + sort <out.multi >sorted.multi &&
16 + test_cmp sorted.single sorted.multi
17 + fi
18 '
19
20 test_expect_success 'calibrate' '
@@ -46,7 +49,7 @@ test_perf "single-threaded, $desc" "
49 test-lazy-init-name-hash --single --count=$count
50 "
51
49 -test_perf "multi-threaded, $desc" "
52 +test_perf REPO_BIG_ENOUGH_FOR_MULTI "multi-threaded, $desc" "
53 test-lazy-init-name-hash --multi --count=$count
54 "
55