code: def test_get_output_3(workflow_start_regular, tmp_path):
      cnt_file = tmp_path / "counter"
      cnt_file.write_text("0")
      error_flag = tmp_path / "error"
      error_flag.touch()
  
      @ray.remote
      def incr():
          v = int(cnt_file.read_text())
          cnt_file.write_text(str(v + 1))
          if error_flag.exists():
              raise ValueError()
          return 10
  
      with pytest.raises(workflow.WorkflowExecutionError):
          workflow.run(
              incr.options(max_retries=0).bind(), workflow_id="incr"
          )
  
      assert cnt_file.read_text() == "1"
  
      from ray.exceptions import RaySystemError
  
      # TODO(suquark): We should prevent Ray from raising "RaySystemError",
      #   in workflow, because "RaySystemError" does not inherit the underlying
      #   error, so users and developers cannot catch the expected error.
      #   I feel this issue is a very annoying.
      with pytest.raises((RaySystemError, ValueError)):
          workflow.get_output("incr")
  
      assert cnt_file.read_text() == "1"
      error_flag.unlink()
      with pytest.raises((RaySystemError, ValueError)):
          workflow.get_output("incr")
      assert workflow.resume("incr") == 10
  
file_path: ray/python/ray/workflow/tests/test_basic_workflows_2.py
imports: import pytest
  import ray
  from filelock import FileLock
  from ray._private.test_utils import SignalActor
  from ray import workflow
  from ray.tests.conftest import *
  from ray._private.test_utils import skip_flaky_core_test_premerge
label_desc: Use image node_id 4 for calling a global function with example usage: test_get_output_3(workflow_start_regular, tmp_path) and returns: int