Title: [120611] trunk/Tools
Revision
120611
Author
dpra...@chromium.org
Date
2012-06-18 11:45:20 -0700 (Mon, 18 Jun 2012)

Log Message

nrwt: metered output doesn't handle ^C cleanly
https://bugs.webkit.org/show_bug.cgi?id=89249

Reviewed by Tony Chang.

If you ctrl-c a running nrwt (w/o --verbose), then all but
two characters of the last update are erased, and then we print
"interrupted, exiting" as an update, which itself then gets
erased. Fix this so that we flush the meter (making the last
update persistent, so that we print the ^C for a visual clue),
print the interrupt message, and move on ...

* Scripts/webkitpy/layout_tests/controllers/manager.py:
(Manager._run_tests):
* Scripts/webkitpy/layout_tests/views/metered_stream.py:
(MeteredStream.flush):
* Scripts/webkitpy/layout_tests/views/printing.py:
(Printer._write):
(Printer):
(Printer.flush):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (120610 => 120611)


--- trunk/Tools/ChangeLog	2012-06-18 18:37:46 UTC (rev 120610)
+++ trunk/Tools/ChangeLog	2012-06-18 18:45:20 UTC (rev 120611)
@@ -1,3 +1,26 @@
+2012-06-18  Dirk Pranke  <dpra...@chromium.org>
+
+        nrwt: metered output doesn't handle ^C cleanly
+        https://bugs.webkit.org/show_bug.cgi?id=89249
+
+        Reviewed by Tony Chang.
+
+        If you ctrl-c a running nrwt (w/o --verbose), then all but
+        two characters of the last update are erased, and then we print
+        "interrupted, exiting" as an update, which itself then gets
+        erased. Fix this so that we flush the meter (making the last
+        update persistent, so that we print the ^C for a visual clue),
+        print the interrupt message, and move on ...
+
+        * Scripts/webkitpy/layout_tests/controllers/manager.py:
+        (Manager._run_tests):
+        * Scripts/webkitpy/layout_tests/views/metered_stream.py:
+        (MeteredStream.flush):
+        * Scripts/webkitpy/layout_tests/views/printing.py:
+        (Printer._write):
+        (Printer):
+        (Printer.flush):
+
 2012-06-18  Xianzhu Wang  <wangxian...@chromium.org>
 
         [Chromium] Change back "linuxish" to "linux" and include WebFontRendering.cpp on Android

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py (120610 => 120611)


--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py	2012-06-18 18:37:46 UTC (rev 120610)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py	2012-06-18 18:45:20 UTC (rev 120611)
@@ -814,7 +814,8 @@
                         _log.error('Worker %d did not exit in time.' % worker_state.number)
 
         except KeyboardInterrupt:
-            self._printer.print_update('Interrupted, exiting ...')
+            self._printer.flush()
+            self._printer.write('Interrupted, exiting ...')
             self.cancel_workers()
             keyboard_interrupted = True
         except TestRunInterruptedException, e:

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/views/metered_stream.py (120610 => 120611)


--- trunk/Tools/Scripts/webkitpy/layout_tests/views/metered_stream.py	2012-06-18 18:37:46 UTC (rev 120610)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/views/metered_stream.py	2012-06-18 18:45:20 UTC (rev 120611)
@@ -114,6 +114,11 @@
         self._stream.write(self._erasure(self._last_partial_line))
         self._last_partial_line = ''
 
+    def flush(self):
+        if self._last_partial_line:
+            self._stream.write('\n')
+            self._last_partial_line = ''
+            self._stream.flush()
 
 class _LogHandler(logging.Handler):
     def __init__(self, meter):

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/views/printing.py (120610 => 120611)


--- trunk/Tools/Scripts/webkitpy/layout_tests/views/printing.py	2012-06-18 18:37:46 UTC (rev 120610)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/views/printing.py	2012-06-18 18:45:20 UTC (rev 120611)
@@ -409,3 +409,6 @@
 
     def _write(self, msg):
         self._meter.writeln(msg)
+
+    def flush(self):
+        self._meter.flush()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to