Browse Source

check processes in github workflow

Alex Cheema 1 year ago
parent
commit
67a1aaa823
1 changed files with 26 additions and 0 deletions
  1. 26 0
      .github/workflows/test.yml

+ 26 - 0
.github/workflows/test.yml

@@ -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" \
@@ -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 '{
@@ -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 '{
@@ -154,6 +177,9 @@ jobs:
           }')
         echo "Response 2: $response_2"
 
+        # Check processes after second response
+        check_processes
+
         # Stop both instances
         kill $PID1 $PID2