code: def test_timeout_and_delete_endpoint_by_name_retries_resource_deletion_on_failure(
      _show_logs,
      _cleanup_logs,
      _delete_schedules_associated_with_endpoint,
      session,
  ):
      session.delete_endpoint = Mock(
          side_effect=ClientError(
              error_response={
                  "Error": {
                      "Code": 403,
                      "Message": "ValidationException",
                  }
              },
              operation_name="Unit Test",
          )
      )
  
      with timeout_and_delete_endpoint_by_name(
          endpoint_name=ENDPOINT_NAME,
          sagemaker_session=session,
          hours=0,
          minutes=0,
          seconds=LONG_TIMEOUT_THAT_WILL_NEVER_BE_EXCEEDED,
          sleep_between_cleanup_attempts=0,
      ):
          pass
      assert session.delete_endpoint.call_count == 3
  
imports: from __future__ import absolute_import
  import time
  import pytest
  from mock import Mock, patch, call
  import stopit
  from botocore.exceptions import ClientError
  from sagemaker.session_settings import SessionSettings
  from tests.integ.timeout import timeout, timeout_and_delete_endpoint_by_name, timeout_and_delete_model_with_transformer
label_desc: Use image node_id 8 for calling a global function with example usage: test_timeout_and_delete_endpoint_by_name_retries_resource_deletion_on_failure(_show_logs, _cleanup_logs, _delete_schedules_associated_with_endpoint, session) without return types