aboutsummaryrefslogtreecommitdiffstats
path: root/test/server_poll.py
diff options
context:
space:
mode:
authorVladimir Repin <32306715+mezotaken@users.noreply.github.com>2022-11-12 12:12:15 +0000
committerVladimir Repin <32306715+mezotaken@users.noreply.github.com>2022-11-12 12:12:15 +0000
commit007f4f7314eabd9cc3a2b0d11889de49ad3c682a (patch)
treed62f8156fcb992a069892e75865d318d03c8cb29 /test/server_poll.py
parent98947d173e3f1667eba29c904f681047dea9de90 (diff)
downloadstable-diffusion-webui-gfx803-007f4f7314eabd9cc3a2b0d11889de49ad3c682a.tar.gz
stable-diffusion-webui-gfx803-007f4f7314eabd9cc3a2b0d11889de49ad3c682a.tar.bz2
stable-diffusion-webui-gfx803-007f4f7314eabd9cc3a2b0d11889de49ad3c682a.zip
Tests cleaned up
Diffstat (limited to 'test/server_poll.py')
-rw-r--r--test/server_poll.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/server_poll.py b/test/server_poll.py
index eeefb7eb..8e63b450 100644
--- a/test/server_poll.py
+++ b/test/server_poll.py
@@ -3,7 +3,7 @@ import requests
import time
-def run_tests():
+def run_tests(proc):
timeout_threshold = 240
start_time = time.time()
while time.time()-start_time < timeout_threshold:
@@ -11,8 +11,9 @@ def run_tests():
requests.head("http://localhost:7860/")
break
except requests.exceptions.ConnectionError:
- pass
- if time.time()-start_time < timeout_threshold:
+ if proc.poll() is not None:
+ break
+ if proc.poll() is None:
suite = unittest.TestLoader().discover('', pattern='*_test.py')
result = unittest.TextTestRunner(verbosity=2).run(suite)
else: