diff options
author | Fampai <> | 2022-10-31 13:54:51 +0000 |
---|---|---|
committer | Fampai <> | 2022-10-31 13:54:51 +0000 |
commit | 3b0127e698a2eeb913437bce0b25b478fb06ff11 (patch) | |
tree | e0894e49eb0d7609b12d4e4f3a71fd979830b29c /test/server_poll.py | |
parent | 006756f9cd6258eae418e9209cfc13f940ec53e1 (diff) | |
parent | 9b384dfb5c05129f50cc3f0262f89e8b788e5cf3 (diff) | |
download | stable-diffusion-webui-gfx803-3b0127e698a2eeb913437bce0b25b478fb06ff11.tar.gz stable-diffusion-webui-gfx803-3b0127e698a2eeb913437bce0b25b478fb06ff11.tar.bz2 stable-diffusion-webui-gfx803-3b0127e698a2eeb913437bce0b25b478fb06ff11.zip |
Merge branch 'master' of https://github.com/AUTOMATIC1111/stable-diffusion-webui into TI_optimizations
Diffstat (limited to 'test/server_poll.py')
-rw-r--r-- | test/server_poll.py | 19 |
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") |