Skip to content
Browse files

Merge pull request #48 from EvanKrall/error_messages_on_bailing

Print error messages when we bail due to timeout or too many failures.
  • Loading branch information...
2 parents 050e630 + b1ee00b commit 8e398e3263f651736084138eda3e5e1ef5ae2df6 @ayust ayust committed Feb 6, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 testify/test_runner_server.py
View
4 testify/test_runner_server.py
@@ -10,12 +10,14 @@
import tornado.httpserver
import tornado.ioloop
import tornado.web
+
try:
import simplejson as json
_hush_pyflakes = [json]
del _hush_pyflakes
except ImportError:
import json
+import logging
import Queue
import time
@@ -134,6 +136,7 @@ def post(handler):
d['failed_methods'][result['method']['name']] = result
self.failure_count += 1
if self.failure_limit and self.failure_count >= self.failure_limit:
+ logging.error('Too many failures, shutting down.')
self.early_shutdown()
return handler.finish("Too many failures, shutting down.")
@@ -174,6 +177,7 @@ def get_error_html(handler, status_code, **kwargs):
def timeout_server():
if time.time() > self.last_activity_time + self.server_timeout:
+ logging.error('No client activity for %ss, shutting down.' % self.server_timeout)
self.shutdown()
else:
tornado.ioloop.IOLoop.instance().add_timeout(self.last_activity_time + self.server_timeout, timeout_server)

0 comments on commit 8e398e3

Please sign in to comment.
Something went wrong with that request. Please try again.