We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4a1e0ce commit 1183a94Copy full SHA for 1183a94
1 file changed
tests/opentelemetry-docker-tests/tests/check_availability.py
@@ -43,7 +43,7 @@
43
MSSQL_USER = os.getenv("MSSQL_USER", "sa")
44
MSSQL_PASSWORD = os.getenv("MSSQL_PASSWORD", "yourStrong(!)Password")
45
RETRY_COUNT = 8
46
-RETRY_INTERVAL = 5 # Seconds
+RETRY_INITIAL_INTERVAL = 2 # Seconds
47
48
logger = logging.getLogger(__name__)
49
@@ -56,14 +56,16 @@ def wrapper():
56
func()
57
return
58
except Exception as ex: # pylint: disable=broad-except
59
+ # Exponential backoff
60
+ backoff_interval = RETRY_INITIAL_INTERVAL * (2**i)
61
logger.error(
62
"waiting for %s, retry %d/%d [%s]",
63
func.__name__,
64
i + 1,
65
RETRY_COUNT,
66
ex,
67
)
- time.sleep(RETRY_INTERVAL)
68
+ time.sleep(backoff_interval)
69
raise Exception(f"waiting for {func.__name__} failed")
70
71
return wrapper
0 commit comments