code: def test_actor_pass_by_ref_order_optimization(shutdown_only):
      ray.init(num_cpus=4)
  
      @ray.remote
      class Actor:
          def __init__(self):
              pass
  
          def f(self, x):
              pass
  
      a = Actor.remote()
  
      @ray.remote
      def fast_value():
          print("fast value")
          pass
  
      @ray.remote
      def slow_value():
          print("start sleep")
          time.sleep(30)
  
      @ray.remote
      def runner(f):
          print("runner", a, f)
          return ray.get(a.f.remote(f.remote()))
  
      runner.remote(slow_value)
      time.sleep(1)
      x2 = runner.remote(fast_value)
      start = time.time()
      ray.get(x2)
      delta = time.time() - start
      assert delta < 10, "did not skip slow value"
  
imports: import array
  import logging
  import os
  import random
  import subprocess
  import sys
  import tempfile
  import threading
  import time
  from unittest.mock import MagicMock, patch
  import pytest
  from ray._private.ray_constants import KV_NAMESPACE_FUNCTION_TABLE
  from ray._private.test_utils import client_test_enabled
  from ray.cluster_utils import Cluster, cluster_not_supported
  from ray.exceptions import GetTimeoutError, RayTaskError
  from ray.tests.client_test_utils import create_remote_signal_actor
label_desc: Use image node_id 6 for calling a global function with example usage: test_actor_pass_by_ref_order_optimization(shutdown_only) and returns: ray