Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
perfcheck: Try multiple (shorter) attempts
Browse files Browse the repository at this point in the history
To mitigate against the variation in performance in TravisCI's test
environment, perfcheck will now try multiple attempts at passing. Each
attempt is 3 iterations of benchmark runs.

This increases the chances of success and makes the overall test run
time shorter if the first attempt passes.
  • Loading branch information
mjs committed Apr 3, 2018
1 parent 1c065ba commit 64595a9
Showing 1 changed file with 24 additions and 18 deletions.
42 changes: 24 additions & 18 deletions perfcheck
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
GO_PACKAGE=github.com/jumptrading/influx-spout
REFERENCE_REVISION=${REFERENCE_REVISION:-aa46d4677bb8ef72848c211312d9051b879322dc}

iterations=5
max_attempts=3
iterations=3
orig_gopath=$GOPATH

echo "Comparing working tree against $REFERENCE_REVISION"
Expand Down Expand Up @@ -70,25 +71,30 @@ git checkout --quiet -b perfcheck $REFERENCE_REVISION > /dev/null
popd > /dev/null
set +e

# Remove output from previous runs
rm -f $reference_bench_output $current_bench_output

# Run the tests for the current benchmarks and reference benchmarks
# $iterations times. The runs are interleaved to minimise the effects
# of other load on the host.
for i in `seq $iterations`; do
title "Iteration $i/$iterations"

title "Running current benchmarks"
export GOPATH=$orig_gopath
capture_benchmarks "$test_sizes" $current_bench_output

title "Running reference benchmarks"
export GOPATH=$ref_gopath
pushd $clone_dir > /dev/null
capture_benchmarks "$test_sizes" $reference_bench_output
popd > /dev/null
done
for a in `seq $max_attempts`; do
title "Attempt $a ($max_attempts max)"

# Remove output from previous runs
rm -f $reference_bench_output $current_bench_output

for i in `seq $iterations`; do
title "Iteration $i/$iterations"

title "Comparing benchmarks"
./benchcheck/benchcheck $reference_bench_output $current_bench_output
title "Running current benchmarks"
export GOPATH=$orig_gopath
capture_benchmarks "$test_sizes" $current_bench_output

title "Running reference benchmarks"
export GOPATH=$ref_gopath
pushd $clone_dir > /dev/null
capture_benchmarks "$test_sizes" $reference_bench_output
popd > /dev/null
done

title "Comparing benchmarks"
./benchcheck/benchcheck $reference_bench_output $current_bench_output && exit 0
done

0 comments on commit 64595a9

Please sign in to comment.