aboutsummaryrefslogtreecommitdiffstats
path: root/test/server_poll.py
diff options
context:
space:
mode:
authorVladimir Repin <32306715+mezotaken@users.noreply.github.com>2022-11-14 11:36:07 +0000
committerVladimir Repin <32306715+mezotaken@users.noreply.github.com>2022-11-14 11:36:07 +0000
commit0646040667b59526ac8346d53efd14dc0e75b01e (patch)
tree0d63875bf408020c3e5d7e06f28bd4c0f31acf6b /test/server_poll.py
parent3ffc1c6ceee169fac767a956fd0d4f153b005dbf (diff)
downloadstable-diffusion-webui-gfx803-0646040667b59526ac8346d53efd14dc0e75b01e.tar.gz
stable-diffusion-webui-gfx803-0646040667b59526ac8346d53efd14dc0e75b01e.tar.bz2
stable-diffusion-webui-gfx803-0646040667b59526ac8346d53efd14dc0e75b01e.zip
Propagate test error and try it without localhost
Diffstat (limited to 'test/server_poll.py')
-rw-r--r--test/server_poll.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/server_poll.py b/test/server_poll.py
index c71e906a..028fd476 100644
--- a/test/server_poll.py
+++ b/test/server_poll.py
@@ -8,7 +8,7 @@ def run_tests(proc, test_dir):
start_time = time.time()
while time.time()-start_time < timeout_threshold:
try:
- requests.head("http://localhost:7860/")
+ requests.head("http://127.0.0.1:7860/")
break
except requests.exceptions.ConnectionError:
if proc.poll() is not None:
@@ -18,5 +18,7 @@ def run_tests(proc, test_dir):
test_dir = ""
suite = unittest.TestLoader().discover(test_dir, pattern="*_test.py", top_level_dir="test")
result = unittest.TextTestRunner(verbosity=2).run(suite)
+ return len(result.failures)
else:
print("Launch unsuccessful")
+ return 1