docstr: Tests if the decorator correctly checks the list of messages
  provided. In this case, we check if it correctly fails.
docstr_tok: ["Tests","if","the","decorator","correctly","checks","the","list","of","messages","provided",".","In","this","case",",","we","check","if","it","correctly","fails","."]
code: def test_message_checking_fail(self) -> None:
      """
      Tests if the decorator correctly checks the list of messages
      provided. In this case, we check if it correctly fails.
      """
  
      class DecoratorTester:
          @retry_on_exception(
              default_return_on_suppression="SUCCESS",
              check_message_contains=["Hello", "World"],
              exception_types=(RuntimeError,),
          )
          def error_throwing_function(self) -> None:
              # The execption thrown below should NOT be caught as it does not
              # contain the keywords we want
              raise RuntimeError
  
      decorator_tester = DecoratorTester()
      with self.assertRaises(RuntimeError):
          decorator_tester.error_throwing_function()
  
file_path: Ax/ax/utils/common/tests/test_executils.py
imports: import logging
  import time
  from asyncio import iscoroutinefunction
  from unittest.mock import Mock
  from ax.utils.common.executils import retry_on_exception
  from ax.utils.common.testutils import TestCase
label_desc: Use image node_id 5 for calling the TestRetryDecorator obj's underlying member method code with example usage: obj.test_message_checking_fail() without return types