Skip to content

Commit c5a9157

Browse files
rscharfegitster
authored andcommitted
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 <[email protected]> Acked-by: Jeff Hostetler <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7b0d409 commit c5a9157

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

t/perf/p0004-lazy-init-name-hash.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ test_checkout_worktree
88

99
test_expect_success 'verify both methods build the same hashmaps' '
1010
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
1518
'
1619

1720
test_expect_success 'calibrate' '
@@ -46,7 +49,7 @@ test_perf "single-threaded, $desc" "
4649
test-lazy-init-name-hash --single --count=$count
4750
"
4851

49-
test_perf "multi-threaded, $desc" "
52+
test_perf REPO_BIG_ENOUGH_FOR_MULTI "multi-threaded, $desc" "
5053
test-lazy-init-name-hash --multi --count=$count
5154
"
5255

0 commit comments

Comments
 (0)