Skip to content

Commit

Permalink
fix(ci): add wait_process_exit in backwards compat test (#15326)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwannoel authored Feb 29, 2024
1 parent 09f5e9a commit ac86d9c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions backwards-compat-tests/scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,23 @@ kill_zookeeper() {
wait_zookeeper_exit
}

wait_for_process() {
process_name="$1"

while pgrep -x "$process_name" > /dev/null; do
echo "Process $process_name is still running... Wait for 1 sec"
sleep 1
done
}

wait_all_process_exit() {
wait_for_process meta-node
wait_for_process compute-node
wait_for_process frontend
wait_for_process compactor
echo "All processes has exited."
}

# Older versions of RW may not gracefully kill kafka.
# So we duplicate the definition here.
kill_cluster() {
Expand All @@ -75,6 +92,7 @@ kill_cluster() {

tmux kill-session -t risedev
test $? -eq 0 || { echo "Failed to stop all RiseDev components."; exit 1; }
wait_all_process_exit
}

run_sql () {
Expand Down

0 comments on commit ac86d9c

Please sign in to comment.