code: def test_error_message():
      """
      Check that we get a good error message when running against an old server version.
      """
      client = JobSubmissionClient("http://127.0.0.1:8265")
  
      # Check that a basic job successfully runs.
      job_id = client.submit_job(
          entrypoint="echo 'hello world'",
      )
      wait_for_condition(
          lambda: client.get_job_status(job_id) == JobStatus.SUCCEEDED
      )
  
      # `entrypoint_num_cpus`, `entrypoint_num_gpus`, and `entrypoint_resources`
      # are not supported in ray<2.2.0.
      for unsupported_submit_kwargs in [
          {"entrypoint_num_cpus": 1},
          {"entrypoint_num_gpus": 1},
          {"entrypoint_resources": {"custom": 1}},
      ]:
          with pytest.raises(
              Exception,
              match="Ray version 2.0.1 is running on the cluster. "
              "`entrypoint_num_cpus`, `entrypoint_num_gpus`, and "
              "`entrypoint_resources` kwargs"
              " are not supported on the Ray cluster. Please ensure the cluster is "
              "running Ray 2.2 or higher.",
          ):
              client.submit_job(
                  entrypoint="echo hello",
                  **unsupported_submit_kwargs,
              )
  
      with pytest.raises(
          Exception,
          match="Ray version 2.0.1 is running on the cluster. "
          "`entrypoint_memory` kwarg"
          " is not supported on the Ray cluster. Please ensure the cluster is "
          "running Ray 2.8 or higher.",
      ):
          client.submit_job(
              entrypoint="echo hello",
              entrypoint_memory=4,
          )
  
      assert True
  
file_path: ray/dashboard/modules/job/tests/test_backwards_compatibility.py
imports: import logging
  import pytest
  import sys
  import os
  import subprocess
  import uuid
  from contextlib import contextmanager
  from ray.job_submission import JobSubmissionClient, JobStatus
  from ray._private.test_utils import wait_for_condition
label_desc: Use image node_id 3 for calling a global function with example usage: test_error_message() without return types