code: def test_move_log_files_to_old(shutdown_only):
      info = ray.init(num_cpus=1)
  
      logs_dir = os.path.join(info["session_dir"], "logs")
  
      @ray.remote
      class Actor:
          def f(self):
              print("function f finished")
  
      # First create a temporary actor.
      actors = [
          Actor.remote()
          for i in range(ray_constants.LOG_MONITOR_MAX_OPEN_FILES)
      ]
      ray.get([a.f.remote() for a in actors])
  
      # Make sure no log files are in the "old" directory before the actors
      # are killed.
      assert len(glob.glob(f"{logs_dir}/old/worker*.out")) == 0
  
      # Now kill the actors so the files get moved to logs/old/.
      [a.__ray_terminate__.remote() for a in actors]
  
      while True:
          log_file_paths = glob.glob(f"{logs_dir}/old/worker*.out")
          if len(log_file_paths) > 0:
              with open(log_file_paths[0], "r") as f:
                  assert "function f finished\n" in f.readlines()
              break
  
      # Make sure that nothing has died.
      assert ray._private.services.remaining_processes_alive()
  
imports: import glob
  import logging
  import multiprocessing
  import os
  import sys
  import tempfile
  import time
  from unittest import mock
  import numpy
  import psutil
  import pytest
  import ray
  import ray._private.gcs_utils
  import ray._private.ray_constants
  import ray._private.utils
  import ray.cluster_utils
  import ray.util.accelerators
  from ray._private.test_utils import wait_for_condition
  from ray.dashboard import k8s_utils
  from ray.runtime_env import RuntimeEnv
label_desc: Use image node_id 3 for calling a global function with example usage: test_move_log_files_to_old(shutdown_only) without return types