aboutsummaryrefslogtreecommitdiffstats
path: root/test/server_poll.py
diff options
context:
space:
mode:
authorBruno Seoane <brunoseoaneamarillo@gmail.com>2022-11-01 15:06:10 +0000
committerBruno Seoane <brunoseoaneamarillo@gmail.com>2022-11-01 15:06:10 +0000
commit31db25ecc8d9c3996e7bac00cc616ee12557b7d3 (patch)
treea2126c45535b989a7954ff30e142d73d1848cb0a /test/server_poll.py
parent952ff32a5ffe7495721272a3443714b93c267ca9 (diff)
parent458cca03915ba437ac65a2087965f3885e6022bc (diff)
downloadstable-diffusion-webui-gfx803-31db25ecc8d9c3996e7bac00cc616ee12557b7d3.tar.gz
stable-diffusion-webui-gfx803-31db25ecc8d9c3996e7bac00cc616ee12557b7d3.tar.bz2
stable-diffusion-webui-gfx803-31db25ecc8d9c3996e7bac00cc616ee12557b7d3.zip
Merge branch 'master' of https://github.com/AUTOMATIC1111/stable-diffusion-webui
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")