@@ -372,6 +372,16 @@ jobs:
372372 echo "Verifying MLflow service exists..."
373373 KUBECONFIG="$KUBECONFIG_FILE" kubectl get svc -n values-test
374374
375+ # Check pod status and wait for them to be running
376+ echo "Checking pod status..."
377+ KUBECONFIG="$KUBECONFIG_FILE" kubectl get pods -n values-test
378+
379+ echo "Waiting for MLflow pods to be running..."
380+ KUBECONFIG="$KUBECONFIG_FILE" kubectl wait --for=condition=Ready pods --selector=app.kubernetes.io/name=mlflow -n values-test --timeout=2m || {
381+ echo "WARNING: Timed out waiting for pods to be ready, will try port-forwarding anyway"
382+ KUBECONFIG="$KUBECONFIG_FILE" kubectl describe pods -n values-test
383+ }
384+
375385 # Set up port forwarding in the background
376386 echo "Setting up port forwarding to run in the background"
377387 nohup bash -c "KUBECONFIG='$KUBECONFIG_FILE' kubectl port-forward -n values-test svc/mlflow $PORT:5000 &>/tmp/port-forward-${{ github.run_id }}.log" &
@@ -383,8 +393,9 @@ jobs:
383393 echo "hostname=localhost:$PORT" >> $GITHUB_OUTPUT
384394 echo "Test endpoint will be: localhost:$PORT"
385395
386- # Simple wait for port-forward to establish
387- sleep 5
396+ # Give port-forward more time to establish
397+ echo "Waiting for port-forward to establish..."
398+ sleep 15
388399
389400 # Basic connectivity check
390401 echo "Checking connectivity to MLflow..."
@@ -395,6 +406,10 @@ jobs:
395406 # Show the port-forward log for debugging
396407 echo "Port-forward log:"
397408 cat /tmp/port-forward-${{ github.run_id }}.log || true
409+
410+ # If port-forward failed, check pod logs
411+ echo "Pod logs:"
412+ KUBECONFIG="$KUBECONFIG_FILE" kubectl logs -n values-test -l app.kubernetes.io/name=mlflow --tail=20 || true
398413 fi
399414 env :
400415 KUBECONFIG : ${{ steps.create-cluster.outputs.cluster-kubeconfig }}
0 commit comments