code: def test_gradio_ingress_correctness(
      serve_start_shutdown, use_user_defined_class: bool
  ):
      """
      Ensure a Gradio app deployed to a cluster through GradioIngress still
      produces the correct output.
      """
  
      def greet(name):
          return f"Good morning {name}!"
  
      if use_user_defined_class:
  
          @serve.deployment
          class UserDefinedGradioServer(GradioIngress):
              def __init__(self):
                  super().__init__(
                      lambda: gr.Interface(
                          fn=greet, inputs="text", outputs="text"
                      )
                  )
  
          app = UserDefinedGradioServer.bind()
      else:
          app = GradioServer.bind(
              lambda: gr.Interface(
                  fn=greet, inputs="text", outputs="text"
              )
          )
  
      serve.run(app)
  
      test_input = "Alice"
      response = requests.post(
          "http://127.0.0.1:8000/api/predict/",
          json={"data": [test_input]},
      )
      assert response.status_code == 200 and response.json()["data"][
          0
      ] == greet(test_input)
  
file_path: ray/python/ray/serve/tests/test_gradio.py
imports: import os
  import sys
  import gradio
  import pytest
  import requests
  import ray
  from ray import serve
  from ray._private.test_utils import wait_for_condition
  from ray.serve.gradio_integrations import GradioIngress, GradioServer
label_desc: Use image node_id 2 for calling a global function with example usage: test_gradio_ingress_correctness(serve_start_shutdown, use_user_defined_class) and returns: str, name, str