92
92
fi
93
93
annotate_grafana_end greedy_agent " ${scenario} : Greedy agent traffic"
94
94
95
- return ${status}
95
+ return " ${status} "
96
96
}
97
97
fi
98
98
99
- if [[ ${SCALETEST_PARAM_LOAD_SCENARIO_RUN_CONCURRENTLY} == 1 ]]; then
100
- start_phase " Load scenarios: ${SCALETEST_PARAM_LOAD_SCENARIOS[*]} "
101
- fi
102
-
103
99
run_scenario_cmd () {
104
100
local scenario=${1}
105
101
shift
@@ -127,6 +123,9 @@ declare -A failed=()
127
123
target_start=0
128
124
target_end=-1
129
125
126
+ if [[ ${SCALETEST_PARAM_LOAD_SCENARIO_RUN_CONCURRENTLY} == 1 ]]; then
127
+ start_phase " Load scenarios: ${SCALETEST_PARAM_LOAD_SCENARIOS[*]} "
128
+ fi
130
129
for scenario in " ${SCALETEST_PARAM_LOAD_SCENARIOS[@]} " ; do
131
130
if [[ ${SCALETEST_PARAM_LOAD_SCENARIO_RUN_CONCURRENTLY} == 0 ]]; then
132
131
start_phase " Load scenario: ${scenario} "
@@ -320,24 +319,24 @@ for scenario in "${SCALETEST_PARAM_LOAD_SCENARIOS[@]}"; do
320
319
# scenario is run concurrently and all percentages add up to 100.
321
320
target_start=${target_end}
322
321
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
334
323
pid_to_scenario+=([" ${pids[-1]} " ]=" ${scenario} " )
335
324
# Stagger the start of each scenario to avoid a burst of load and deted
336
325
# problematic scenarios.
337
326
sleep $(( SCALETEST_PARAM_LOAD_SCENARIO_CONCURRENCY_STAGGERING * 60 ))
327
+ continue
338
328
fi
339
- done
340
329
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
341
340
if [[ ${SCALETEST_PARAM_LOAD_SCENARIO_RUN_CONCURRENTLY} == 1 ]]; then
342
341
wait " ${pids[@]} "
343
342
# 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
348
347
scenario=${pid_to_scenario[${pid}]}
349
348
if (( status > 0 )) ; then
350
349
log " Load scenario failed: ${scenario} (exit=${status} )"
351
- failed+=([" ${scenario} " ]=" $status " )
350
+ failed+=([" ${scenario} " ]=" ${ status} " )
352
351
fi
353
352
done
354
353
if (( ${# failed[@]} > 0 )) ; then
0 commit comments