code: def test_metrics_export_now(shutdown_only):
      info = ray.init(num_cpus=2, **SLOW_METRIC_CONFIG)
  
      driver = """
  import ray
  import time
  
  ray.init("auto")
  
  @ray.remote
  def f():
      pass
  a = [f.remote() for _ in range(10)]
  ray.get(a)
  """
  
      # If force export at process death is broken, we won't see the recently completed
      # tasks from the drivers.
      for i in range(10):
          print("Run job", i)
          run_string_as_driver(driver)
          tasks_by_state(info)
  
      expected = {
          "FINISHED": 100.0,
      }
      wait_for_condition(
          lambda: tasks_by_state(info) == expected,
          timeout=20,
          retry_interval_ms=500,
      )
  
imports: from collections import defaultdict
  import sys
  import os
  import copy
  import pytest
  import ray
  from ray._private.metrics_agent import RAY_WORKER_TIMEOUT_S
  from ray._private.test_utils import raw_metrics, run_string_as_driver, run_string_as_driver_nonblocking, wait_for_condition
label_desc: Use image node_id 16 for calling a global function with example usage: test_metrics_export_now(shutdown_only) without return types