Skip to content

Commit

Permalink
chore: try kill existing benchmark process for 10 times
Browse files Browse the repository at this point in the history
  • Loading branch information
guitarrapc committed Nov 1, 2024
1 parent 76cc3ad commit 48bc807
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
13 changes: 8 additions & 5 deletions .github/scripts/benchmark-client-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,14 @@ echo "::endgroup::"

echo "::group::Kill existing process"
title "Checking process $binary_name already runnning, kill if exists"
ps -eo pid,cmd | while read -r pid cmd; do
if echo "$cmd" | grep -E "^./$binary_name" >/dev/null 2>&1; then
print "Found & killing process $pid ($cmd)"
kill "$pid"
fi
for i in {1..10}; do
ps -eo pid,cmd | while read -r pid cmd; do
if echo "$cmd" | grep -E "^./$binary_name" >/dev/null 2>&1; then
print "($i/10) Found & killing process $pid ($cmd)"
kill "$pid"
fi
done
sleep 0.2
done
echo "::endgroup::"

Expand Down
15 changes: 9 additions & 6 deletions .github/scripts/benchmark-server-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,15 @@ echo "::group::Setup environment variables"
echo "::endgroup::"

echo "::group::Kill existing process"
title "Checking process $binary_name already runnning, kill if exists"
ps -eo pid,cmd | while read -r pid cmd; do
if echo "$cmd" | grep -E "^./$binary_name" >/dev/null 2>&1; then
print "Found & killing process $pid ($cmd)"
kill "$pid"
fi
title "Checking process $binary_name already runnning, kill if exists. try 10 times until no process found"
for i in {1..10}; do
ps -eo pid,cmd | while read -r pid cmd; do
if echo "$cmd" | grep -E "^./$binary_name" >/dev/null 2>&1; then
print "($i/10) Found & killing process $pid ($cmd)"
kill "$pid"
fi
done
sleep 0.2
done
echo "::endgroup::"

Expand Down

0 comments on commit 48bc807

Please sign in to comment.