code: def test_local_mode_deadlock(shutdown_only_with_initialization_check):
      ray.init(local_mode=True)
  
      @ray.remote
      class Foo:
          def __init__(self):
              pass
  
          def ping_actor(self, actor):
              actor.ping.remote()
              return 3
  
      @ray.remote
      class Bar:
          def __init__(self):
              pass
  
          def ping(self):
              return 1
  
      foo = Foo.remote()
      bar = Bar.remote()
      # Expect ping_actor call returns normally without deadlock.
      assert ray.get(foo.ping_actor.remote(bar)) == 3
  
imports: import os
  import sys
  import time
  import pytest
  import ray
  import ray._private.ray_constants
  from ray._private.test_utils import Semaphore, enable_external_redis, client_test_enabled, run_string_as_driver, wait_for_condition, get_gcs_memory_used, run_string_as_driver_nonblocking
  from ray.experimental.internal_kv import _internal_kv_list
  from ray.tests.conftest import call_ray_start
  import subprocess
  import psutil
label_desc: Use image node_id 3 for calling a global function with example usage: test_local_mode_deadlock(shutdown_only_with_initialization_check) and returns: int, int