code: def test_borrowed_id_failure(one_worker_100MiB, failure):
      @ray.remote
      class Parent:
          def __init__(self):
              pass
  
          def pass_ref(self, ref, borrower):
              self.ref = ref[0]
              ray.get(borrower.receive_ref.remote(ref))
              if failure:
                  sys.exit(-1)
  
          def ping(self):
              return
  
      @ray.remote
      class Borrower:
          def __init__(self):
              self.ref = None
  
          def receive_ref(self, ref):
              self.ref = ref[0]
  
          def resolve_ref(self):
              assert self.ref is not None
              if failure:
                  with pytest.raises(
                      ray.exceptions.ReferenceCountingAssertionError
                  ):
                      ray.get(self.ref)
              else:
                  ray.get(self.ref)
  
          def ping(self):
              return
  
      parent = Parent.remote()
      borrower = Borrower.remote()
      ray.get(borrower.ping.remote())
  
      obj = ray.put(np.zeros(20 * 1024 * 1024, dtype=np.uint8))
      if failure:
          with pytest.raises(ray.exceptions.RayActorError):
              ray.get(parent.pass_ref.remote([obj], borrower))
      else:
          ray.get(parent.pass_ref.remote([obj], borrower))
      obj_bytes = obj.binary()
      del obj
  
      _fill_object_store_and_get(obj_bytes, succeed=not failure)
      # The borrower should not hang when trying to get the object's value.
      ray.get(borrower.resolve_ref.remote())
  
imports: import logging
  import os
  import copy
  import platform
  import random
  import signal
  import sys
  import time
  import numpy
  import pytest
  import ray
  import ray.cluster_utils
  from ray._private.internal_api import memory_summary
  from ray._private.test_utils import SignalActor, put_object, wait_for_condition, wait_for_num_actors
  import ray._private.gcs_utils
label_desc: Use image node_id 8 for calling a global function with example usage: test_borrowed_id_failure(one_worker_100MiB, failure) without return types