From 9a9e463c239bb861a6fb79753f15a3cce0156156 Mon Sep 17 00:00:00 2001 From: "Kenta Goto (k.goto)" <24818752+go-to-k@users.noreply.github.com> Date: Mon, 27 Jan 2025 14:44:10 +0900 Subject: [PATCH] test: wait for asynchronous loops in the test deployment shells for each constant process (#300) --- testdata/deploy.sh | 11 ++++++++++- testdata/deploy_directory.sh | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/testdata/deploy.sh b/testdata/deploy.sh index 07205e3..2737be3 100644 --- a/testdata/deploy.sh +++ b/testdata/deploy.sh @@ -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 diff --git a/testdata/deploy_directory.sh b/testdata/deploy_directory.sh index e1406dc..4a19b48 100644 --- a/testdata/deploy_directory.sh +++ b/testdata/deploy_directory.sh @@ -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