code: def test_failed_task_unschedulable(shutdown_only):
      ray.init(num_cpus=1, _system_config=_SYSTEM_CONFIG)
  
      node_id = ray.get_runtime_context().get_node_id()
      policy = (
          ray.util.scheduling_strategies.NodeAffinitySchedulingStrategy(
              node_id=node_id,
              soft=False,
          )
      )
  
      @ray.remote
      def task():
          pass
  
      task.options(
          scheduling_strategy=policy,
          name="task-unschedulable",
          num_cpus=2,
      ).remote()
  
      wait_for_condition(
          verify_failed_task,
          name="task-unschedulable",
          error_type="TASK_UNSCHEDULABLE_ERROR",
          error_message=(
              "The node specified via NodeAffinitySchedulingStrategy"
              " doesn't exist any more or is infeasible"
          ),
      )
  
imports: from collections import defaultdict
  from typing import Dict
  import os
  import pytest
  import sys
  import threading
  import time
  from ray._private.state_api_test_utils import verify_failed_task
  from ray.exceptions import RuntimeEnvSetupError
  from ray.runtime_env import RuntimeEnv
  import ray
  from ray.util.state.common import ListApiOptions, StateResource
  from ray._private.test_utils import raw_metrics, run_string_as_driver, run_string_as_driver_nonblocking, wait_for_condition
  from ray.util.state import StateApiClient, list_tasks
  from ray._private.worker import RayContext
label_desc: Use image node_id 5 for calling a global function with example usage: test_failed_task_unschedulable(shutdown_only) without return types