diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2022-12-03 07:19:51 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-03 07:19:51 +0000 |
commit | c9a2cfdf2a53d37c2de1908423e4f548088667ef (patch) | |
tree | eabdca1b7665e0ee00f130e9f8544ffd23e474a2 /test/server_poll.py | |
parent | 39541d7725bc42f456a604b07c50aba503a5a09a (diff) | |
parent | 5cd5a672f7889dcc018c3873ec557d645ebe35d0 (diff) | |
download | stable-diffusion-webui-gfx803-c9a2cfdf2a53d37c2de1908423e4f548088667ef.tar.gz stable-diffusion-webui-gfx803-c9a2cfdf2a53d37c2de1908423e4f548088667ef.tar.bz2 stable-diffusion-webui-gfx803-c9a2cfdf2a53d37c2de1908423e4f548088667ef.zip |
Merge branch 'master' into racecond_fix
Diffstat (limited to 'test/server_poll.py')
-rw-r--r-- | test/server_poll.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/test/server_poll.py b/test/server_poll.py index eeefb7eb..d4df697b 100644 --- a/test/server_poll.py +++ b/test/server_poll.py @@ -3,7 +3,7 @@ import requests import time -def run_tests(): +def run_tests(proc, test_dir): timeout_threshold = 240 start_time = time.time() while time.time()-start_time < timeout_threshold: @@ -11,9 +11,14 @@ def run_tests(): 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') + if proc.poll() is not None: + break + if proc.poll() is None: + if test_dir is None: + test_dir = "" + suite = unittest.TestLoader().discover(test_dir, pattern="*_test.py", top_level_dir="test") result = unittest.TextTestRunner(verbosity=2).run(suite) + return len(result.failures) + len(result.errors) else: print("Launch unsuccessful") + return 1 |