"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "0ecdf6de036f5c06de8dc31e6508358e71482cdd"
Unverified Commit 145bf41c authored by Yih-Dar's avatar Yih-Dar Committed by GitHub
Browse files

Allow to add more information in `is_flaky` (#21426)



* Allow to add more information

* fix style

---------
Co-authored-by: default avatarydshieh <ydshieh@users.noreply.github.com>
parent 8298e4ec
...@@ -1690,7 +1690,7 @@ class RequestCounter: ...@@ -1690,7 +1690,7 @@ class RequestCounter:
return self.old_request(method=method, **kwargs) 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. 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): ...@@ -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. The maximum number of attempts to retry the flaky test.
wait_before_retry (`float`, *optional*): wait_before_retry (`float`, *optional*):
If provided, will wait that number of seconds before retrying the test. 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): def decorator(test_func_ref):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment