code: def test_deadlock_actor_with_nested_task(
      ray_with_memory_monitor,
  ):
      leaker = ActorWithNestedTask.options(
          max_restarts=0, max_task_retries=0
      ).remote()
      actor_bytes = get_additional_bytes_to_reach_memory_usage_pct(
          memory_usage_threshold - 0.1
      )
      nested_task_bytes = (
          get_additional_bytes_to_reach_memory_usage_pct(
              memory_usage_threshold + 0.1
          )
          - actor_bytes
      )
      with pytest.raises(ray.exceptions.RayTaskError) as _:
          ray.get(
              leaker.perform_allocations.remote(
                  actor_bytes, nested_task_bytes
              )
          )
  
imports: import sys
  import threading
  import pytest
  import ray
  from ray.tests.test_memory_pressure import allocate_memory, Leaker, get_additional_bytes_to_reach_memory_usage_pct, memory_usage_threshold, memory_monitor_refresh_ms
label_desc: Use image node_id 8 for calling a global function with example usage: test_deadlock_actor_with_nested_task(ray_with_memory_monitor) without return types