'If the function fails multiple times and then succeeds,
``retry_failure`` returns the success.'

@capture_logging(assert_logged_multiple_iterations)
def test_multiple_iterations(self, logger):

    steps = [0.1, 0.2]
    result = object()
    results = [Failure(ValueError('bad    value')), Failure(ValueError('bad    value')), succeed(result)]
    def function():
        ITERATION_MESSAGE(iteration=(3 - len(results))).write()
        return results.pop(0)
    clock = Clock()
    d = retry_failure(clock, function, steps=steps)
    self.assertNoResult(d)
    clock.advance(0.1)
    self.assertNoResult(d)
    clock.advance(0.1)
    self.assertNoResult(d)
    clock.advance(0.1)
    self.assertEqual(self.successResultOf(d), result)
