Skip to content

Commit 0d653f0

Browse files
Add retries to flask ready-check
1 parent 3e2b693 commit 0d653f0

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

tests/test_notifier.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import pytest
77
import requests
88
import websockets
9+
from requests.adapters import HTTPAdapter
10+
from urllib3 import Retry
911

1012
from fishjam import FishjamClient, FishjamNotifier, RoomOptions
1113
from fishjam.events import (
@@ -34,7 +36,18 @@ def start_server():
3436
flask_process = Process(target=run_server, args=(queue,))
3537
flask_process.start()
3638

37-
response = requests.get(WEBHOOK_SERVER_URL, timeout=5)
39+
session = requests.Session()
40+
session.mount(
41+
"http",
42+
HTTPAdapter(
43+
max_retries=Retry(
44+
total=5,
45+
backoff_factor=0.25,
46+
)
47+
),
48+
)
49+
50+
response = session.get(WEBHOOK_SERVER_URL, timeout=5)
3851
response.raise_for_status()
3952

4053
yield

0 commit comments

Comments
 (0)