Changes between Version 1 and Version 2 of Ticket #32831, comment 6
- Timestamp:
- Jun 10, 2021, 7:40:07 AM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #32831, comment 6
v1 v2 1 A possible pattern for fixing issues like this would be to keep retrying the assertion in a `while` loop, with a small sleep in between each attempt, and a relatively large cumulative amount of time before giving up. That would make it as pass as quickly as possible, without waiting longer than necessary. I'm thinking something like--1 A possible pattern for fixing issues like this would be to keep retrying the assertion in a `while` loop, with a small sleep in between each attempt, and a relatively large cumulative amount of time before giving up. That would make it as pass as quickly as possible, without waiting longer than necessary. I'm thinking of something like-- 2 2 3 3 {{{#!python 4 def assert_with_retries(self, assert_func, interval_time, total_time, *args, **kwargs):4 def assert_with_retries(self, assert_func, *args, interval_time=0.1, total_time=10, **kwargs): 5 5 start = time.time() 6 6 while True: