Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix script exit before subprocesses
  • Loading branch information
mafredri committed Oct 17, 2023
commit f7ec1758a3d32a53c4efb3f6f6c286df2efb7ae4
7 changes: 6 additions & 1 deletion scaletest/templates/scaletest-runner/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ annotate_grafana "workspace" "Agent running" # Ended in shutdown.sh.
trap 'trap - EXIT; kill -INT "${pids[@]}"; exit 1' INT EXIT

while :; do
sleep 285 # ~300 when accounting for profile and trace.
# Sleep for short periods of time so that we can exit quickly.
# This adds up to ~300 when accounting for profile and trace.
for ((i = 0; i < 285; i++)); do
sleep 1
done
log "Grabbing pprof dumps"
start="$(date +%s)"
annotate_grafana "pprof" "Grab pprof dumps (start=${start})"
Expand Down Expand Up @@ -132,6 +136,7 @@ on_exit() {

annotate_grafana_end "" "Start scaletest: ${SCALETEST_COMMENT}"

wait "${pprof_pid}"
exit "${code}"
}
trap on_exit EXIT
Expand Down