code: def test_runtime_metadata(workflow_start_regular):
      task_id = "simple_task"
      workflow_id = "simple"
  
      @workflow.options(task_id=task_id)
      @ray.remote
      def simple():
          time.sleep(2)
          return 0
  
      workflow.run(simple.bind(), workflow_id=workflow_id)
  
      workflow_metadata = workflow.get_metadata("simple")
      assert "start_time" in workflow_metadata["stats"]
      assert "end_time" in workflow_metadata["stats"]
      assert (
          workflow_metadata["stats"]["end_time"]
          >= workflow_metadata["stats"]["start_time"] + 2
      )
  
      task_metadata = workflow.get_metadata("simple", "simple_task")
      assert "start_time" in task_metadata["stats"]
      assert "end_time" in task_metadata["stats"]
      assert (
          task_metadata["stats"]["end_time"]
          >= task_metadata["stats"]["start_time"] + 2
      )
  
file_path: ray/python/ray/workflow/tests/test_metadata.py
imports: import time
  from ray.tests.conftest import *
  import pytest
  import ray
  from ray import workflow
label_desc: Use image node_id 5 for calling a global function with example usage: test_runtime_metadata(workflow_start_regular) and returns: int