Changes between Version 1 and Version 2 of Ticket #32831, comment 6


Ignore:
Timestamp:
Jun 10, 2021, 7:40:07 AM (4 years ago)
Author:
Chris Jerdonek

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--
     1A 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--
    22
    33{{{#!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):
    55        start = time.time()
    66        while True:
Back to Top