File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
tests/opentelemetry-docker-tests/tests Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 4242MSSQL_PORT = int (os .getenv ("MSSQL_PORT" , "1433" ))
4343MSSQL_USER = os .getenv ("MSSQL_USER" , "sa" )
4444MSSQL_PASSWORD = os .getenv ("MSSQL_PASSWORD" , "yourStrong(!)Password" )
45- RETRY_COUNT = 8
46- RETRY_INTERVAL = 5 # Seconds
45+ RETRY_COUNT = 5
46+ RETRY_INITIAL_INTERVAL = 2 # Seconds
4747
4848logger = logging .getLogger (__name__ )
4949
@@ -56,14 +56,16 @@ def wrapper():
5656 func ()
5757 return
5858 except Exception as ex : # pylint: disable=broad-except
59+ # Exponential backoff
60+ backoff_interval = RETRY_INITIAL_INTERVAL * (2 ** i )
5961 logger .error (
6062 "waiting for %s, retry %d/%d [%s]" ,
6163 func .__name__ ,
6264 i + 1 ,
6365 RETRY_COUNT ,
6466 ex ,
6567 )
66- time .sleep (RETRY_INTERVAL )
68+ time .sleep (backoff_interval )
6769 raise Exception (f"waiting for { func .__name__ } failed" )
6870
6971 return wrapper
You can’t perform that action at this time.
0 commit comments