File tree Expand file tree Collapse file tree 1 file changed +4
-13
lines changed
Expand file tree Collapse file tree 1 file changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -36,19 +36,10 @@ def start_server():
3636 flask_process = Process (target = run_server , args = (queue ,))
3737 flask_process .start ()
3838
39- timeout = 60 # wait maximum of 60 seconds
40- while True :
41- try :
42- response = requests .get (WEBHOOK_SERVER_URL , timeout = 1_000 )
43- if response .status_code == 200 : # Or another condition
44- break
45- except (requests .ConnectionError , socket .error ):
46- time .sleep (1 ) # wait for 1 second before trying again
47- timeout -= 1
48- if timeout == 0 :
49- pytest .fail ("Server did not start in the expected time" )
50-
51- yield # This is where the testing happens.
39+ response = requests .get (WEBHOOK_SERVER_URL , timeout = 3 )
40+ response .raise_for_status ()
41+
42+ yield
5243
5344 flask_process .terminate ()
5445
You can’t perform that action at this time.
0 commit comments