Skip to content

Commit b9e4d84

Browse files
jeffhostetlergitster
authored andcommitted
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/<testname>.<testnumber>.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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0785eb7 commit b9e4d84

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

t/perf/perf-lib.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ test_perf_ () {
230230
test_ok_ "$1"
231231
fi
232232
"$TEST_DIRECTORY"/perf/min_time.perl test_time.* >"$base".result
233+
rm test_time.*
233234
}
234235

235236
test_perf () {

0 commit comments

Comments
 (0)