Changeset 159749 in webkit


Ignore:
Timestamp:
Nov 25, 2013 7:48:07 AM (10 years ago)
Author:
commit-queue@webkit.org
Message:

EWS creates 0 byte sized log files
https://bugs.webkit.org/show_bug.cgi?id=107606

Patch by László Langó <lango@inf.u-szeged.hu> on 2013-11-25
Reviewed by Ryosuke Niwa.

There was a modification in r138264, that tried to make less log,
because some of the messeges were duplicated. After this the EWS
created the log file (with the same name as the bugID) but doesn't
write anything into it, even if there were errors during the build.
From now only creates the log file only if there is some error.

  • Scripts/webkitpy/tool/bot/queueengine.py:

(QueueEngine.run): If the build and tests pass, there is no ScriptError raised,
there is nothing to log. Open the log file only if a ScriptError was raised to
avoid to make empty log files for bugs.
(QueueEngine._open_work_log): Does not need to tee STDOUT to log file anymore,
because of changes in r138264. Teeing is used for locally testing purposes and
this feature is not used anymore.
(QueueEngine._ensure_work_log_closed): Close the logfile. We don't use output
teeing anymore. It is a necessary change because of QueueEngine._open_work_log
change.

  • Scripts/webkitpy/tool/bot/queueengine_unittest.py:

(LoggingDelegate): The order of the callbacks was changed by this patch.
(QueueEngineTest.test_trivial): Won't create log file if the queue was terminated,
so we have to update this test.
(QueueEngineTest.test_unexpected_error): The order of the callbacks was changed by
this patch.

  • Scripts/webkitpy/tool/commands/earlywarningsystem.py:

(AbstractEarlyWarningSystem.review_patch): Raise again the captured ScriptError
to be able to handle it in QueueEngine.run. Without this change, the existing
exception handler never run (the process_work_item method never raise ScriptError)
We can get the error message only from the ScriptError at this point.

Location:
trunk/Tools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r159710 r159749  
     12013-11-25  László Langó  <lango@inf.u-szeged.hu>
     2
     3        EWS creates 0 byte sized log files
     4        https://bugs.webkit.org/show_bug.cgi?id=107606
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        There was a modification in r138264, that tried to make less log,
     9        because some of the messeges were duplicated. After this the EWS
     10        created the log file (with the same name as the bugID) but doesn't
     11        write anything into it, even if there were errors during the build.
     12        From now only creates the log file only if there is some error.
     13
     14        * Scripts/webkitpy/tool/bot/queueengine.py:
     15        (QueueEngine.run): If the build and tests pass, there is no ScriptError raised,
     16        there is nothing to log. Open the log file only if a ScriptError was raised to
     17        avoid to make empty log files for bugs.
     18        (QueueEngine._open_work_log): Does not need to tee STDOUT to log file anymore,
     19        because of changes in r138264. Teeing is used for locally testing purposes and
     20        this feature is not used anymore.
     21        (QueueEngine._ensure_work_log_closed): Close the logfile. We don't use output
     22        teeing anymore. It is a necessary change because of QueueEngine._open_work_log
     23        change.
     24        * Scripts/webkitpy/tool/bot/queueengine_unittest.py:
     25        (LoggingDelegate): The order of the callbacks was changed by this patch.
     26        (QueueEngineTest.test_trivial): Won't create log file if the queue was terminated,
     27        so we have to update this test.
     28        (QueueEngineTest.test_unexpected_error): The order of the callbacks was changed by
     29        this patch.
     30        * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
     31        (AbstractEarlyWarningSystem.review_patch): Raise again the captured ScriptError
     32        to be able to handle it in QueueEngine.run. Without this change, the existing
     33        exception handler never run (the process_work_item method never raise ScriptError)
     34        We can get the error message only from the ScriptError at this point.
     35
    1362013-11-22  Dean Jackson  <dino@apple.com>
    237
  • trunk/Tools/Scripts/webkitpy/tool/bot/queueengine.py

    r159696 r159749  
    9898                    continue
    9999
    100                 # FIXME: Work logs should not depend on bug_id specificaly.
    101                 #        This looks fixed, no?
    102                 self._open_work_log(work_item)
    103100                try:
    104101                    if not self._delegate.process_work_item(work_item):
     
    106103                        continue
    107104                except ScriptError, e:
     105                    self._open_work_log(work_item)
     106                    self._work_log.write(e.message_with_output())
    108107                    # Use a special exit code to indicate that the error was already
    109108                    # handled in the child process and we should just keep looping.
     
    140139        if not work_item_log_path:
    141140            return
    142         self._work_log = self._output_tee.add_log(work_item_log_path)
     141        self._work_log = self._output_tee._open_log_file(work_item_log_path)
    143142
    144143    def _ensure_work_log_closed(self):
    145144        # If we still have a bug log open, close it.
    146145        if self._work_log:
    147             self._output_tee.remove_log(self._work_log)
     146            self._work_log.close()
    148147            self._work_log = None
    149148
  • trunk/Tools/Scripts/webkitpy/tool/bot/queueengine_unittest.py

    r143109 r159749  
    5151        'should_continue_work_queue',
    5252        'next_work_item',
     53        'process_work_item',
    5354        'work_item_log_path',
    54         'process_work_item',
    5555        'should_continue_work_queue',
    5656        'stop_work_queue',
     
    120120    def test_trivial(self):
    121121        delegate = LoggingDelegate(self)
     122        expected_callbacks = LoggingDelegate.expected_callbacks[:]
     123        expected_callbacks.remove('work_item_log_path')
    122124        self._run_engine(delegate)
    123125        self.assertEqual(delegate.stop_message, "Delegate terminated queue.")
    124         self.assertEqual(delegate._callbacks, LoggingDelegate.expected_callbacks)
     126        self.assertEqual(delegate._callbacks, expected_callbacks)
    125127        self.assertTrue(os.path.exists(os.path.join(self.temp_dir, "queue_log_path")))
    126         self.assertTrue(os.path.exists(os.path.join(self.temp_dir, "work_log_path", "work_item.log")))
    127128
    128129    def test_unexpected_error(self):
     
    130131        self._run_engine(delegate)
    131132        expected_callbacks = LoggingDelegate.expected_callbacks[:]
    132         work_item_index = expected_callbacks.index('process_work_item')
     133        work_item_log_path_index = expected_callbacks.index('work_item_log_path')
    133134        # The unexpected error should be handled right after process_work_item starts
    134135        # but before any other callback.  Otherwise callbacks should be normal.
    135         expected_callbacks.insert(work_item_index + 1, 'handle_unexpected_error')
     136        expected_callbacks.insert(work_item_log_path_index + 1, 'handle_unexpected_error')
    136137        self.assertEqual(delegate._callbacks, expected_callbacks)
    137138
  • trunk/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem.py

    r159696 r159749  
    9393                self._upload_results_archive_for_patch(patch, results_archive)
    9494            self._did_fail(patch)
    95             # FIXME: We're supposed to be able to raise e again here and have
    96             # one of our base classes mark the patch as fail, but there seems
    97             # to be an issue with the exit_code.
    98             return False
     95            raise e
    9996
    10097    # EarlyWarningSystemDelegate methods
Note: See TracChangeset for help on using the changeset viewer.