Skip to content

Commit 23d936e

Browse files
committed
minor cleanup
1 parent 60df607 commit 23d936e

File tree

1 file changed

+17
-18
lines changed
  • scaletest/templates/scaletest-runner/scripts

1 file changed

+17
-18
lines changed

scaletest/templates/scaletest-runner/scripts/run.sh

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,10 @@ else
9292
fi
9393
annotate_grafana_end greedy_agent "${scenario}: Greedy agent traffic"
9494

95-
return ${status}
95+
return "${status}"
9696
}
9797
fi
9898

99-
if [[ ${SCALETEST_PARAM_LOAD_SCENARIO_RUN_CONCURRENTLY} == 1 ]]; then
100-
start_phase "Load scenarios: ${SCALETEST_PARAM_LOAD_SCENARIOS[*]}"
101-
fi
102-
10399
run_scenario_cmd() {
104100
local scenario=${1}
105101
shift
@@ -127,6 +123,9 @@ declare -A failed=()
127123
target_start=0
128124
target_end=-1
129125

126+
if [[ ${SCALETEST_PARAM_LOAD_SCENARIO_RUN_CONCURRENTLY} == 1 ]]; then
127+
start_phase "Load scenarios: ${SCALETEST_PARAM_LOAD_SCENARIOS[*]}"
128+
fi
130129
for scenario in "${SCALETEST_PARAM_LOAD_SCENARIOS[@]}"; do
131130
if [[ ${SCALETEST_PARAM_LOAD_SCENARIO_RUN_CONCURRENTLY} == 0 ]]; then
132131
start_phase "Load scenario: ${scenario}"
@@ -320,24 +319,24 @@ for scenario in "${SCALETEST_PARAM_LOAD_SCENARIOS[@]}"; do
320319
# scenario is run concurrently and all percentages add up to 100.
321320
target_start=${target_end}
322321

323-
if [[ ${SCALETEST_PARAM_LOAD_SCENARIO_RUN_CONCURRENTLY} == 0 ]]; then
324-
if ((status > 0)); then
325-
log "Load scenario failed: ${scenario} (exit=${status})"
326-
failed+=(["${scenario}"]="$status")
327-
PHASE_ADD_TAGS=error end_phase
328-
else
329-
end_phase
330-
fi
331-
332-
wait_baseline "${SCALETEST_PARAM_LOAD_SCENARIO_BASELINE_DURATION}"
333-
else
322+
if [[ ${SCALETEST_PARAM_LOAD_SCENARIO_RUN_CONCURRENTLY} == 1 ]]; then
334323
pid_to_scenario+=(["${pids[-1]}"]="${scenario}")
335324
# Stagger the start of each scenario to avoid a burst of load and deted
336325
# problematic scenarios.
337326
sleep $((SCALETEST_PARAM_LOAD_SCENARIO_CONCURRENCY_STAGGERING * 60))
327+
continue
338328
fi
339-
done
340329

330+
if ((status > 0)); then
331+
log "Load scenario failed: ${scenario} (exit=${status})"
332+
failed+=(["${scenario}"]="${status}")
333+
PHASE_ADD_TAGS=error end_phase
334+
else
335+
end_phase
336+
fi
337+
338+
wait_baseline "${SCALETEST_PARAM_LOAD_SCENARIO_BASELINE_DURATION}"
339+
done
341340
if [[ ${SCALETEST_PARAM_LOAD_SCENARIO_RUN_CONCURRENTLY} == 1 ]]; then
342341
wait "${pids[@]}"
343342
# Wait on all pids will wait until all have exited, but we need to
@@ -348,7 +347,7 @@ if [[ ${SCALETEST_PARAM_LOAD_SCENARIO_RUN_CONCURRENTLY} == 1 ]]; then
348347
scenario=${pid_to_scenario[${pid}]}
349348
if ((status > 0)); then
350349
log "Load scenario failed: ${scenario} (exit=${status})"
351-
failed+=(["${scenario}"]="$status")
350+
failed+=(["${scenario}"]="${status}")
352351
fi
353352
done
354353
if ((${#failed[@]} > 0)); then

0 commit comments

Comments
 (0)