code: def test_node_info_basic(shutdown_only, monkeypatch):
      with monkeypatch.context() as m:
          m.setenv("RAY_CLOUD_INSTANCE_ID", "instance-id")
          m.setenv("RAY_NODE_TYPE_NAME", "node-type-name")
          m.setenv("RAY_CLOUD_INSTANCE_TYPE_NAME", "instance-type-name")
  
          ctx = ray.init(num_cpus=1)
          ip = ctx.address_info["node_ip_address"]
  
          stub = _autoscaler_state_service_stub()
  
          def verify():
              state = get_cluster_resource_state(stub)
  
              assert len(state.node_states) == 1
              node = state.node_states[0]
  
              assert node.instance_id == "instance-id"
              assert node.ray_node_type_name == "node-type-name"
              assert node.node_ip_address == ip
              assert node.instance_type_name == "instance-type-name"
  
              assert (
                  state.cluster_session_name
                  == ray._private.worker.global_worker.node.session_name
              )
              return True
  
          wait_for_condition(verify)
  
imports: import os
  import sys
  import time
  from dataclasses import dataclass
  from typing import Callable, List, Optional, Tuple
  import pytest
  import ray
  import ray._private.ray_constants
  from ray._private.test_utils import wait_for_condition
  from ray.autoscaler.v2.schema import ClusterStatus, LaunchRequest, NodeInfo, ResourceRequestByCount
  from ray.autoscaler.v2.sdk import get_cluster_status, request_cluster_resources
  from ray.autoscaler.v2.tests.util import get_available_resources, get_cluster_resource_state, get_total_resources, report_autoscaling_state
  from ray.core.generated import autoscaler_pb2, autoscaler_pb2_grpc
  from ray.core.generated.autoscaler_pb2 import ClusterResourceState, NodeStatus
  from ray.util.state.api import list_nodes
label_desc: Use image node_id 9 for calling a global function with example usage: test_node_info_basic(shutdown_only, monkeypatch) and returns: True