Skip to content

Commit

Permalink
test: wait for asynchronous loops in the test deployment shells for e…
Browse files Browse the repository at this point in the history
…ach constant process (#300)
  • Loading branch information
go-to-k authored Jan 27, 2025
1 parent a202d13 commit 9a9e463
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
11 changes: 10 additions & 1 deletion testdata/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,15 @@ for bucket_num in $(seq 1 ${num_buckets}); do
rm -rf ${dir}
) &
pids[$!]=$!

# Wait for every 10 processes to complete before starting new ones
if [ ${#pids[@]} -eq 10 ]; then
wait "${pids[@]}"
pids=()
fi
done

wait "${pids[@]}"
# Wait for remaining processes
if [ ${#pids[@]} -gt 0 ]; then
wait "${pids[@]}"
fi
11 changes: 10 additions & 1 deletion testdata/deploy_directory.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ for bucket_num in $(seq 1 ${num_buckets}); do
rm -rf ${dir}
) &
pids[$!]=$!

# Wait for every 10 processes to complete before starting new ones
if [ ${#pids[@]} -eq 10 ]; then
wait "${pids[@]}"
pids=()
fi
done

wait "${pids[@]}"
# Wait for remaining processes
if [ ${#pids[@]} -gt 0 ]; then
wait "${pids[@]}"
fi

0 comments on commit 9a9e463

Please sign in to comment.