code: def test_chain_dag(ray_start_regular, num_actors):
      actors = [Actor.remote(i) for i in range(num_actors)]
      with InputNode() as inp:
          dag = inp
          for a in actors:
              dag = a.append_to.bind(dag)
  
      compiled_dag = dag.experimental_compile()
  
      for i in range(3):
          output_channel = compiled_dag.execute([])
          # TODO(swang): Replace with fake ObjectRef.
          result = output_channel.begin_read()
          assert result == list(range(num_actors))
          output_channel.end_read()
  
      compiled_dag.teardown()
  
imports: import logging
  import os
  import random
  import sys
  import time
  import pytest
  import ray
  import ray.cluster_utils
  from ray.exceptions import RaySystemError
  from ray.dag import InputNode, MultiOutputNode
  from ray.tests.conftest import *
label_desc: Use image node_id 4 for calling a global function with example usage: test_chain_dag(ray_start_regular, num_actors) without return types