aboutsummaryrefslogtreecommitdiffstats
path: root/test/server_poll.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2022-11-04 06:02:15 +0000
committerGitHub <noreply@github.com>2022-11-04 06:02:15 +0000
commit4918eb6ce484caa4bc5a9f668bb466a5122a9c87 (patch)
tree76a0e42461d620764ad810c5b8dbd5b28d757519 /test/server_poll.py
parent80844ac861504e7c67a3d4dec0cbed9f6f4b3e24 (diff)
parent2cf3d2ac15530dbc8fdb486a4dac03b710972445 (diff)
downloadstable-diffusion-webui-gfx803-4918eb6ce484caa4bc5a9f668bb466a5122a9c87.tar.gz
stable-diffusion-webui-gfx803-4918eb6ce484caa4bc5a9f668bb466a5122a9c87.tar.bz2
stable-diffusion-webui-gfx803-4918eb6ce484caa4bc5a9f668bb466a5122a9c87.zip
Merge branch 'master' into hn-activation
Diffstat (limited to 'test/server_poll.py')
-rw-r--r--test/server_poll.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/server_poll.py b/test/server_poll.py
new file mode 100644
index 00000000..eeefb7eb
--- /dev/null
+++ b/test/server_poll.py
@@ -0,0 +1,19 @@
+import unittest
+import requests
+import time
+
+
+def run_tests():
+ timeout_threshold = 240
+ start_time = time.time()
+ while time.time()-start_time < timeout_threshold:
+ try:
+ requests.head("http://localhost:7860/")
+ break
+ except requests.exceptions.ConnectionError:
+ pass
+ if time.time()-start_time < timeout_threshold:
+ suite = unittest.TestLoader().discover('', pattern='*_test.py')
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ else:
+ print("Launch unsuccessful")