Commit 95f68a53 authored by eric@webkit.org's avatar eric@webkit.org

2010-08-24 Eric Seidel <eric@webkit.org>

        Reviewed by Adam Barth.

        commit-queue and EWS bots should report all failures
        https://bugs.webkit.org/show_bug.cgi?id=41820

        Right now commit-queue/EWS only report failures when the
        patch under testing fails.  We should report all failures
        to the status server so that we can diagnose when the bots
        are wedged w/o needing to log into the machines.

        I also reduced the amount of data we upload since we've seen
        timeouts during status upload.

        * Scripts/webkitpy/common/system/executive.py:
        * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
        * Scripts/webkitpy/tool/commands/queues.py:
        * Scripts/webkitpy/tool/commands/queues_unittest.py:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65979 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 34e90339
2010-08-24 Eric Seidel <eric@webkit.org>
Reviewed by Adam Barth.
commit-queue and EWS bots should report all failures
https://bugs.webkit.org/show_bug.cgi?id=41820
Right now commit-queue/EWS only report failures when the
patch under testing fails. We should report all failures
to the status server so that we can diagnose when the bots
are wedged w/o needing to log into the machines.
I also reduced the amount of data we upload since we've seen
timeouts during status upload.
* Scripts/webkitpy/common/system/executive.py:
* Scripts/webkitpy/tool/commands/earlywarningsystem.py:
* Scripts/webkitpy/tool/commands/queues.py:
* Scripts/webkitpy/tool/commands/queues_unittest.py:
2010-08-24 Eric Seidel <eric@webkit.org>
Reviewed by Adam Barth.
......
......@@ -73,10 +73,10 @@ class ScriptError(Exception):
def message_with_output(self, output_limit=500):
if self.output:
if output_limit and len(self.output) > output_limit:
return "%s\nLast %s characters of output:\n%s" % \
return u"%s\nLast %s characters of output:\n%s" % \
(self, output_limit, self.output[-output_limit:])
return "%s\n%s" % (self, self.output)
return str(self)
return u"%s\n%s" % (self, self.output)
return unicode(self)
def command_name(self):
command_path = self.script_args
......
......@@ -55,7 +55,8 @@ class AbstractEarlyWarningSystem(AbstractReviewQueue):
"--quiet"])
return True
except ScriptError, e:
self._update_status("Unable to perform a build")
failure_log = self._log_from_script_error_for_upload(e)
self._update_status("Unable to perform a build", results_file=failure_log)
return False
def _build(self, patch, first_run=False):
......
......@@ -119,16 +119,25 @@ class AbstractQueue(Command, QueueEngineDelegate):
self.tool = tool
return engine(self.name, self, self.tool.wakeup_event).run()
@classmethod
def _log_from_script_error_for_upload(cls, script_error, output_limit=None):
# We have seen request timeouts with app engine due to large
# log uploads. Trying only the last 512k.
if not output_limit:
output_limit = 512 * 1024 # 512k
output = script_error.message_with_output(output_limit=output_limit)
# We pre-encode the string to a byte array before passing it
# to status_server, because ClientForm (part of mechanize)
# wants a file-like object with pre-encoded data.
return StringIO(output.encode("utf-8"))
@classmethod
def _update_status_for_script_error(cls, tool, state, script_error, is_error=False):
message = str(script_error)
if is_error:
message = "Error: %s" % message
output = script_error.message_with_output(output_limit=1024*1024) # 1MB
# We pre-encode the string to a byte array before passing it
# to status_server, because ClientForm (part of mechanize)
# wants a file-like object with pre-encoded data.
return tool.status_server.update_status(cls.name, message, state["patch"], StringIO(output.encode("utf-8")))
failure_log = cls._log_from_script_error_for_upload(script_error)
return tool.status_server.update_status(cls.name, message, state["patch"], failure_log)
class AbstractPatchQueue(AbstractQueue):
......@@ -203,7 +212,8 @@ class CommitQueue(AbstractPatchQueue, StepSequenceErrorHandler):
"--build-style=both",
"--quiet"])
except ScriptError, e:
self._update_status("Unable to successfully build and test", None)
failure_log = self._log_from_script_error_for_upload(e)
self._update_status("Unable to successfully build and test", results_file=failure_log)
return False
return True
......
......@@ -99,6 +99,19 @@ class AbstractQueueTest(CommandsTest):
self.assertTrue(queue.should_continue_work_queue())
self.assertTrue(queue.should_continue_work_queue())
def _assert_log_message(self, script_error, log_message):
failure_log = AbstractQueue._log_from_script_error_for_upload(script_error, output_limit=10)
self.assertTrue(failure_log.read(), log_message)
def test_log_from_script_error_for_upload(self):
self._assert_log_message(ScriptError("test"), "test")
unicode_tor = u"WebKit \u2661 Tor Arne Vestb\u00F8!"
utf8_tor = unicode_tor.encode("utf-8")
self._assert_log_message(ScriptError(unicode_tor), utf8_tor)
script_error = ScriptError(unicode_tor, output=unicode_tor)
expected_output = "%s\nLast %s characters of output:\n%s" % (utf8_tor, 10, utf8_tor[-10:])
self._assert_log_message(script_error, expected_output)
class AbstractReviewQueueTest(CommandsTest):
def test_patch_collection_delegate_methods(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment