aboutsummaryrefslogtreecommitdiffstats
path: root/test/server_poll.py
diff options
context:
space:
mode:
authorSihan Wang <31711261+shwang95@users.noreply.github.com>2022-11-02 06:09:33 +0000
committerGitHub <noreply@github.com>2022-11-02 06:09:33 +0000
commit5c864be010b42373e51eac4c6869d561adca4202 (patch)
tree1de5f558ab056bc766ac51d3612356f0de52b1f8 /test/server_poll.py
parent7bd8581e461623932ffbd5762ee931ee51f798db (diff)
parent65522ff157e4be4095a99421da04ecb0749824ac (diff)
downloadstable-diffusion-webui-gfx803-5c864be010b42373e51eac4c6869d561adca4202.tar.gz
stable-diffusion-webui-gfx803-5c864be010b42373e51eac4c6869d561adca4202.tar.bz2
stable-diffusion-webui-gfx803-5c864be010b42373e51eac4c6869d561adca4202.zip
Merge branch 'AUTOMATIC1111:master' into master
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")