code: def test_main_failure_with_step(
      _get_sagemaker_session,
      load_and_invoke,
      _exit_process,
      handle_error,
      _load_run_object,
  ):
      os.environ["REMOTE_FUNCTION_SECRET_KEY"] = TEST_HMAC_KEY
      ser_err = SerializationError("some failure reason")
      load_and_invoke.side_effect = ser_err
      handle_error.return_value = 1
  
      invoke_function.main(mock_args_with_execution_and_step())
  
      _get_sagemaker_session.assert_called_with(TEST_REGION)
      load_and_invoke.assert_called()
      _load_run_object.assert_not_called()
      s3_uri = (
          TEST_S3_BASE_URI + TEST_EXECUTION_ID + "/" + TEST_STEP_NAME
      )
      handle_error.assert_called_with(
          error=ser_err,
          sagemaker_session=_get_sagemaker_session(),
          s3_base_uri=s3_uri,
          s3_kms_key=TEST_S3_KMS_KEY,
          hmac_key=TEST_HMAC_KEY,
      )
      _exit_process.assert_called_with(1)
  
file_path: sagemaker-python-sdk/tests/unit/sagemaker/remote_function/test_invoke_function.py
imports: from __future__ import absolute_import
  import os
  import pytest
  from mock import patch, Mock, ANY
  from sagemaker.remote_function import invoke_function
  from sagemaker.remote_function.errors import SerializationError
  from sagemaker.remote_function.core.pipeline_variables import Context
  from sagemaker.utils import sagemaker_timestamp
label_desc: Use image node_id 9 for calling a global function with example usage: test_main_failure_with_step(_get_sagemaker_session, load_and_invoke, _exit_process, handle_error, _load_run_object) without return types