git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] perf-lib: remove old result files before running tests
@ 2019-11-19 18:50 Thomas Gummerer
  2019-11-20  4:12 ` Junio C Hamano
  2019-11-21 10:20 ` Jeff King
  0 siblings, 2 replies; 7+ messages in thread
From: Thomas Gummerer @ 2019-11-19 18:50 UTC (permalink / raw)
  To: git; +Cc: Jeff King, Thomas Gummerer

The perf tests write files recording the results of tests.  These
results are later aggregated by 'aggregate.perl'.  If the tests are
run multiple times, those results are overwritten by the new results.
This works just fine as long as there are only perf tests measuring
the times, whose results are stored in "$base".times files.

However 22bec79d1a ("t/perf: add infrastructure for measuring sizes",
2018-08-17) introduced a new type of test for measuring the size of
something.  The results of this are written to "$base".size files.

"$base" is essentially made up of the basename of the script plus the
test number.  So if test numbers shift because a new test was
introduced earlier in the script we might end up with both a ".times"
and a ".size" file for the same test.  In the aggregation script the
".times" file is preferred over the ".size" file, so some size tests
might end with performance numbers from a previous run of the test.

This is mainly relevant when writing perf tests that check both
performance and sizes, and can get quite confusing during
developement.

Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
---

This came out of something different that I'm working on, but makes
most sense as a standalone patch, rather than part of that series, so
I'm sending this out separately.

 t/perf/perf-lib.sh | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh
index b58a43ea43..7e80251889 100644
--- a/t/perf/perf-lib.sh
+++ b/t/perf/perf-lib.sh
@@ -178,10 +178,11 @@ test_wrapper_ () {
 	export test_prereq
 	if ! test_skip "$@"
 	then
-		base=$(basename "$0" .sh)
-		echo "$test_count" >>"$perf_results_dir"/$base.subtests
-		echo "$1" >"$perf_results_dir"/$base.$test_count.descr
 		base="$perf_results_dir"/"$PERF_RESULTS_PREFIX$(basename "$0" .sh)"."$test_count"
+		rm -f "$base".*
+		no_prefix_base="$perf_results_dir"/$(basename "$0" .sh)
+		echo "$test_count" >>$no_prefix_base.subtests
+		echo "$1" >$no_prefix_base.$test_count.descr
 		"$test_wrapper_func_" "$@"
 	fi
 
-- 
2.24.0.155.gd9f6f3b619


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-11-25 17:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-19 18:50 [PATCH] perf-lib: remove old result files before running tests Thomas Gummerer
2019-11-20  4:12 ` Junio C Hamano
2019-11-20  8:00   ` Thomas Gummerer
2019-11-21 10:20 ` Jeff King
2019-11-22  8:11   ` Thomas Gummerer
2019-11-25 14:09     ` Jeff King
2019-11-25 17:04       ` Thomas Gummerer

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).