Skip to content

Commit 2da1ec7

Browse files
author
Ugaitz Urien
authored
chore(benchmark): Fixing benchmark tests (#146)
Fix and make the CI red when benchmark tests are not executed or they fail. Reduces the iterations of the main scenario, it takes too long.
1 parent 86db147 commit 2da1ec7

2 files changed

Lines changed: 16 additions & 6 deletions

File tree

benchmark/sirun/initialize/meta.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"name": "initialize",
33
"cachegrind": false,
44
"instructions": true,
5-
"iterations": 100,
6-
"timeout": 15,
5+
"iterations": 10,
6+
"timeout": 30,
77
"variants": {
88
"main": {
99
"run": "node ./init.js",

benchmark/sirun/runall.sh

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ run_benchmark() {
6363
echo "running ${dir}/${variant} in background, pinned to core ${CPU_AFFINITY}..."
6464

6565
export SIRUN_VARIANT=$variant
66-
(time node ../run-one-variant.js >> ../results.ndjson && echo "${D}/${V} finished.")
67-
66+
(time node ../run-one-variant.js >> ../results.ndjson && echo "${dir}/${variant} finished.")
67+
6868
cd ..
6969

7070
echo "1" > "core_${cpu_id}.lock_core"
@@ -77,15 +77,25 @@ for dir in "${DIRS[@]}"; do
7777
variants="$(node ../get-variants.js)"
7878
node ../squash-affinity.js
7979
cd ..
80-
for variant in $variants; do
80+
for variant in $variants; do
8181
cpu_id=$(get_next_available_core)
8282
echo "0" > "core_${cpu_id}.lock_core"
8383

8484
run_benchmark $dir $variant $cpu_id &
85+
pids+=($!)
8586
done
8687
done
8788

88-
wait
89+
failed=0
90+
for pid in "${pids[@]}"; do
91+
if ! wait "$pid"; then
92+
failed=1
93+
fi
94+
done
95+
96+
if [ "$failed" -eq 1 ]; then
97+
exit 1
98+
fi
8999

90100
node ./strip-unwanted-results.js
91101

0 commit comments

Comments
 (0)