code: def test_status_invalid_runtime_env(ray_start_stop):
      """Deploys a config file with invalid runtime env and checks status.
  
      get_status() should not throw error (meaning REST API returned 200 status code) and
      the status be deploy failed."""
  
      config_file_name = os.path.join(
          os.path.dirname(__file__),
          "test_config_files",
          "bad_runtime_env.yaml",
      )
  
      subprocess.check_output(["serve", "deploy", config_file_name])
  
      def check_for_failed_deployment():
          cli_output = subprocess.check_output(
              ["serve", "status", "-a", "http://localhost:52365/"]
          )
          cli_status = yaml.safe_load(cli_output)["applications"][
              SERVE_DEFAULT_APP_NAME
          ]
          assert cli_status["status"] == "DEPLOY_FAILED"
          assert (
              "Failed to set up runtime environment"
              in cli_status["message"]
          )
          return True
  
      wait_for_condition(check_for_failed_deployment, timeout=15)
  
imports: import os
  import subprocess
  import sys
  import time
  from copy import deepcopy
  from tempfile import NamedTemporaryFile
  from typing import List
  import click
  import pytest
  import requests
  import yaml
  import ray
  from ray import serve
  from ray._private.test_utils import wait_for_condition
  from ray.serve._private.common import DeploymentID
  from ray.serve._private.constants import SERVE_DEFAULT_APP_NAME, SERVE_NAMESPACE
  from ray.serve.scripts import convert_args_to_dict, remove_ansi_escape_sequences
  from ray.tests.conftest import tmp_working_dir
  from ray.util.state import list_actors
label_desc: Use image node_id 17 for calling a global function with example usage: test_status_invalid_runtime_env(ray_start_stop) and returns: True