aboutsummaryrefslogtreecommitdiff
path: root/test/server_poll.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2022-10-30 07:41:39 +0300
committerGitHub <noreply@github.com>2022-10-30 07:41:39 +0300
commitded08fc1dc515eaeaea3197280d5260ba276c366 (patch)
tree84c21f144f1fc2886109f15edf19d8ee89159dff /test/server_poll.py
parent94840301f86ea204d02e5a0235a15804b495fe8a (diff)
parentffc5b700c417924a77797fc5e02c219f10d801be (diff)
Merge pull request #3941 from mezotaken/master
Automated testing through API [WIP, feedback required]
Diffstat (limited to 'test/server_poll.py')
-rw-r--r--test/server_poll.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/server_poll.py b/test/server_poll.py
new file mode 100644
index 00000000..8c0436f8
--- /dev/null
+++ b/test/server_poll.py
@@ -0,0 +1,17 @@
+import unittest
+import requests
+import time
+
+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")