'Function passed to ``retry_failure`` is run in the context of a
``LOOP_UNTIL_ACTION``.'

def assert_logged_multiple_iterations(self, logger):

    iterations = LoggedMessage.of_type(logger.messages, ITERATION_MESSAGE)
    loop = assertHasAction(self, logger, LOOP_UNTIL_ACTION, True)
    self.assertEqual(sorted(iterations, key=(lambda m: m.message['iteration'])), loop.children)
