Skip to content

Commit

Permalink
check processes in github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexCheema committed Jul 27, 2024
1 parent 9a3ac27 commit 67a1aaa
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,23 @@ jobs:
# Wait for discovery
sleep 10
# Function to check if processes are still running
check_processes() {
if ! kill -0 $PID1 2>/dev/null; then
echo "First instance (PID $PID1) died unexpectedly. Log output:"
cat output1.log
exit 1
fi
if ! kill -0 $PID2 2>/dev/null; then
echo "Second instance (PID $PID2) died unexpectedly. Log output:"
cat output2.log
exit 1
fi
}
# Check processes before proceeding
check_processes
# first one to load the model
curl -s http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
Expand All @@ -136,6 +153,9 @@ jobs:
"temperature": 0.7
}'
# Check processes after model load
check_processes
response_1=$(curl -s http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
Expand All @@ -145,6 +165,9 @@ jobs:
}')
echo "Response 1: $response_1"
# Check processes after first response
check_processes
response_2=$(curl -s http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
Expand All @@ -154,6 +177,9 @@ jobs:
}')
echo "Response 2: $response_2"
# Check processes after second response
check_processes
# Stop both instances
kill $PID1 $PID2
Expand Down

0 comments on commit 67a1aaa

Please sign in to comment.