class_docstr: Unit tests specific to retry decorator.
class_docstr_tok: ["Unit","tests","specific","to","retry","decorator","."]
docstr: If initial attempts fail but subsequent attempt succeeds, ensure that
  expected number of retries is performed and expected value is returned.
docstr_tok: ["If","initial","attempts","fail","but","subsequent","attempt","succeeds",",","ensure","that","expected","number","of","retries","is","performed","and","expected","value","is","returned","."]
code: def testFailsFirstSucceedsLater(self, mockTime, mockSleep):
      """If initial attempts fail but subsequent attempt succeeds, ensure that
      expected number of retries is performed and expected value is returned.
      """
  
      self.mockSleepTime(mockTime, mockSleep)
  
      retryDecorator = decorators.retry(
          timeoutSec=30, initialRetryDelaySec=2, maxRetryDelaySec=10
      )
  
      testFunction = Mock(
          side_effect=[
              TestParentException("Test exception 1"),
              TestParentException("Test exception 2"),
              321,
          ],
          __name__="testFunction",
          autospec=True,
      )
  
      returnValue = retryDecorator(testFunction)()
  
      self.assertEqual(returnValue, 321)
      self.assertEqual(testFunction.call_count, 3)
  
imports: from mock import patch, call, Mock
  from nupic.support.unittesthelpers.testcasebase import unittest
  from nupic.support import decorators
label_desc: Use image node_id 9 for calling the RetryDecoratorTest obj's underlying member method code with example usage: obj.testFailsFirstSucceedsLater(mockTime, mockSleep) without return types