rdm_idx = 4
[Chance : 5] "test_func" will be re-executed after 2 sec.
rdm_idx = 10
[Chance : 4] "test_func" will be re-executed after 2 sec.
rdm_idx = 3
'd'
Failure in 5 chances
test_func(['a'])
rdm_idx = 5
[Chance : 5] "test_func" will be re-executed after 2 sec.
rdm_idx = 2
[Chance : 4] "test_func" will be re-executed after 2 sec.
rdm_idx = 9
[Chance : 3] "test_func" will be re-executed after 2 sec.
rdm_idx = 9
[Chance : 2] "test_func" will be re-executed after 2 sec.
rdm_idx = 6
[Chance : 1] "test_func" will be re-executed after 2 sec.
Exhaustion of all chances
---------------------------------------------------------------------------
TimeoutError Traceback (most recent call last)
File ~/repetition_until_no_exception/repeat.py:15, in repeat.<locals>.a.<locals>.b(*args, **kwargs)
13 time.sleep(waiting_second)
14 print(f'Exhaustion of all chances')
---> 15 raise TimeoutError
TimeoutError: