Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update runparallel.sh for Apple Silicon bringup #46935

Merged
merged 1 commit into from
Feb 16, 2021
Merged
Changes from all commits
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
16 changes: 6 additions & 10 deletions src/tests/runparallel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ function update_results {
# Initialize counters for bookkeeping.
countTotalTests=$(wc -l < $playlistFile)

countFinishedTests=$(cd results.int; grep -r 'RUN_TEST_EXIT_CODE' . | wc -l)
countPassedTests=$(cd results.int; grep -r 'RUN_TEST_EXIT_CODE=0' . | wc -l)
countFailedTests=$((countFinishedTests - countPassedTests))
countFailedTests=$(cd results.int; grep -r 'RUN_TEST_EXIT_CODE=[^0]' . | wc -l)
countFinishedTests=$((countPassedTests + countFailedTests))
countIncompleteTests=$((countTotalTests - countFinishedTests))

print_results
Expand Down Expand Up @@ -183,7 +183,7 @@ time_start=$(date +"%s")
rm -rf results.int/* results.int

echo "Prepping tests $(date +%r)"
xargs -d "\n" -P $NumProc -I{} bash -c prep_test {} < $playlistFile
xargs -L 1 -P $NumProc -I{} bash -c prep_test {} < $playlistFile


trap cleanup EXIT
Expand All @@ -193,21 +193,17 @@ cp $testEnv results.int

trap handle_ctrl_c INT TERM

xargs -d "\n" -P $NumProc -I{} bash -c 'run_test "{}" >/dev/null 2>&1' < $playlistFile &
xargs -L 1 -P $NumProc -I{} bash -c 'run_test "{}" >/dev/null 2>&1' < $playlistFile &

while true
do
update_results
sleep 20 &
wait -n %
if (( $(jobs %xargs 2>/dev/null | wc -l) == 0 )) ;
if (( countIncompleteTests == 0 )) ;
then
break
fi

sleep 60
jobs -p > /dev/null
done

update_results

print_elapsed_time