We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0a94813 commit 9c2fec8Copy full SHA for 9c2fec8
monitoring/api/v3/alerts-client/snippets_test.py
@@ -28,6 +28,10 @@
28
import snippets
29
30
31
+# We assume we have access to good randomness source.
32
+random.seed()
33
+
34
35
def random_name(length):
36
return ''.join(
37
[random.choice(string.ascii_lowercase) for i in range(length)])
@@ -39,7 +43,8 @@ def retry_if_aborted(exception):
39
43
40
44
def delay_on_aborted(err, *args):
41
45
if retry_if_aborted(err[1]):
42
- time.sleep(2)
46
+ # add randomness for avoiding continuous conflict
47
+ time.sleep(2 + (random.randint(0, 9) * 0.1))
48
return True
49
return False
50
0 commit comments