Allow to add more information in is_flaky (#21426)
* Allow to add more information * fix style --------- Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
@@ -1690,7 +1690,7 @@ class RequestCounter:
|
||||
return self.old_request(method=method, **kwargs)
|
||||
|
||||
|
||||
def is_flaky(max_attempts: int = 5, wait_before_retry: Optional[float] = None):
|
||||
def is_flaky(max_attempts: int = 5, wait_before_retry: Optional[float] = None, description: Optional[str] = None):
|
||||
"""
|
||||
To decorate flaky tests. They will be retried on failures.
|
||||
|
||||
@@ -1699,6 +1699,9 @@ def is_flaky(max_attempts: int = 5, wait_before_retry: Optional[float] = None):
|
||||
The maximum number of attempts to retry the flaky test.
|
||||
wait_before_retry (`float`, *optional*):
|
||||
If provided, will wait that number of seconds before retrying the test.
|
||||
description (`str`, *optional*):
|
||||
A string to describe the situation (what / where / why is flaky, link to GH issue/PR comments, errors,
|
||||
etc.)
|
||||
"""
|
||||
|
||||
def decorator(test_func_ref):
|
||||
|
||||
Reference in New Issue
Block a user