From: Jeff Hostetler Date: Mon, 4 Oct 2021 22:29:03 +0000 (+0000) Subject: t/perf/perf-lib.sh: remove test_times.* at the end test_perf_() X-Git-Tag: v2.34.0-rc0~42^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9e4d84878b5c14fd4bd6e94e4e7d9ed0fc95c69;p=thirdparty%2Fgit.git t/perf/perf-lib.sh: remove test_times.* at the end test_perf_() Teach test_perf_() to remove the temporary test_times.* files at the end of each test. test_perf_() runs a particular GIT_PERF_REPEAT_COUNT times and creates ./test_times.[123...]. It then uses a perl script to find the minimum over "./test_times.*" (note the wildcard) and writes that time to "test-results/..result". If the repeat count is changed during the pXXXX test script, stale test_times.* files (from previous steps) may be included in the min() computation. For example: ... GIT_PERF_REPEAT_COUNT=3 \ test_perf "status" " git status " GIT_PERF_REPEAT_COUNT=1 \ test_perf "checkout other" " git checkout other " ... The time reported in the summary for "XXXX.2 checkout other" would be "min( checkout[1], status[2], status[3] )". We prevent that error by removing the test_times.* files at the end of each test. Signed-off-by: Jeff Hostetler Signed-off-by: Junio C Hamano --- diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh index f5ed092ee5..a1b5d2804d 100644 --- a/t/perf/perf-lib.sh +++ b/t/perf/perf-lib.sh @@ -230,6 +230,7 @@ test_perf_ () { test_ok_ "$1" fi "$TEST_DIRECTORY"/perf/min_time.perl test_time.* >"$base".result + rm test_time.* } test_perf () {