diff options
author | random-thoughtss <116161560+random-thoughtss@users.noreply.github.com> | 2022-10-30 07:30:18 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-30 07:30:18 +0000 |
commit | 15468c993974ed30fb204792c9598dfa62088bbb (patch) | |
tree | 313bbeb9d55c752cacfaa08b769c873c3566ebaf /test/server_poll.py | |
parent | 39f55c3c35873bc7dd9792cb2155746a1c3d4292 (diff) | |
parent | 17a2076f72562b428052ee3fc8c43d19c03ecd1e (diff) | |
download | stable-diffusion-webui-gfx803-15468c993974ed30fb204792c9598dfa62088bbb.tar.gz stable-diffusion-webui-gfx803-15468c993974ed30fb204792c9598dfa62088bbb.tar.bz2 stable-diffusion-webui-gfx803-15468c993974ed30fb204792c9598dfa62088bbb.zip |
Merge branch 'AUTOMATIC1111:master' into master
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") |