code: def test_node_affinity_scheduling_strategy_fail_on_unavailable(
      ray_start_cluster,
  ):
      cluster = ray_start_cluster
      cluster.add_node(num_cpus=1)
      ray.init(address=cluster.address)
  
      @ray.remote(num_cpus=1)
      class Actor:
          def get_node_id(self):
              return ray.get_runtime_context().get_node_id()
  
      a1 = Actor.remote()
      target_node_id = ray.get(a1.get_node_id.remote())
  
      a2 = Actor.options(
          scheduling_strategy=NodeAffinitySchedulingStrategy(
              target_node_id, soft=False, _fail_on_unavailable=True
          )
      ).remote()
  
      with pytest.raises(ray.exceptions.ActorUnschedulableError):
          ray.get(a2.get_node_id.remote())
  
imports: import os
  import platform
  import sys
  import time
  import numpy
  import pytest
  import ray
  import ray._private.gcs_utils
  import ray.experimental.internal_kv
  from ray._private.test_utils import make_global_state_accessor, wait_for_condition, get_metric_check_condition, MetricSamplePattern
  from ray.util.client.ray_client_helpers import connect_to_client_or_not
  from ray.util.placement_group import placement_group
  from ray.util.scheduling_strategies import NodeAffinitySchedulingStrategy, PlacementGroupSchedulingStrategy
  from ray._private.test_utils import SignalActor
label_desc: Use image node_id 7 for calling a global function with example usage: test_node_affinity_scheduling_strategy_fail_on_unavailable(ray_start_cluster) and returns: ray