'Two failed attempts to get the lock, then a succcess.'

@DBSubjectLockTest
def testLockRetryWrapperTemporaryFailure(self):

    lock = mock.MagicMock()
    with mock.patch.object(time, 'sleep', return_value=None) as mock_time:
        with mock.patch.object(data_store.DB, 'DBSubjectLock', side_effect=[data_store.DBSubjectLockError('1'), data_store.DBSubjectLockError('2'), lock]):
            lock = data_store.DB.LockRetryWrapper('aff4:/something', token=self.token)
            self.assertEqual(mock_time.call_count, 2)
            lock.Release()
