aboutsummaryrefslogtreecommitdiff
path: root/test/server_poll.py
diff options
context:
space:
mode:
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")