code: def test_failed_and_resumed_workflow(
      workflow_start_regular, tmp_path
  ):
      workflow_id = "simple"
      error_flag = tmp_path / "error"
      error_flag.touch()
  
      @ray.remote
      def simple():
          if error_flag.exists():
              raise ValueError()
          return 0
  
      with pytest.raises(workflow.WorkflowExecutionError):
          workflow.run(simple.bind(), workflow_id=workflow_id)
  
      workflow_metadata_failed = workflow.get_metadata(workflow_id)
      assert workflow_metadata_failed["status"] == "FAILED"
  
      error_flag.unlink()
      assert workflow.resume(workflow_id) == 0
  
      workflow_metadata_resumed = workflow.get_metadata(workflow_id)
      assert workflow_metadata_resumed["status"] == "SUCCESSFUL"
  
      # make sure resume updated running metrics
      assert (
          workflow_metadata_resumed["stats"]["start_time"]
          > workflow_metadata_failed["stats"]["start_time"]
      )
      assert (
          workflow_metadata_resumed["stats"]["end_time"]
          > workflow_metadata_failed["stats"]["end_time"]
      )
  
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 8 for calling a global function with example usage: test_failed_and_resumed_workflow(workflow_start_regular, tmp_path) and returns: int