[test] Verbose test runner output on windows.
authormachenbach <machenbach@chromium.org>
Tue, 26 May 2015 19:50:42 +0000 (12:50 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 26 May 2015 19:50:54 +0000 (19:50 +0000)
TBR=jkummerow@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/1156133006

Cr-Commit-Position: refs/heads/master@{#28643}

tools/run-tests.py
tools/testrunner/local/execution.py
tools/testrunner/local/progress.py

index 274bb18..e8a9598 100755 (executable)
@@ -540,8 +540,14 @@ def Execute(arch, mode, args, options, suites, workspace):
     # Predictable mode is slower.
     timeout *= 2
 
+  # TODO(machenbach): Remove temporary verbose output on windows after
+  # debugging driver-hung-up on XP.
+  verbose_output = (
+      options.verbose or
+      utils.IsWindows() and options.progress == "verbose"
+  )
   ctx = context.Context(arch, MODES[mode]["execution_mode"], shell_dir,
-                        mode_flags, options.verbose,
+                        mode_flags, verbose_output,
                         timeout, options.isolates,
                         options.command_prefix,
                         options.extra_flags,
index 35e0efe..e13393b 100644 (file)
@@ -28,6 +28,7 @@
 
 import os
 import shutil
+import sys
 import time
 
 from pool import Pool
@@ -150,6 +151,7 @@ class Runner(object):
     self.indicator.HasRun(test, has_unexpected_output or test.run > 1)
     if has_unexpected_output:
       # Rerun test failures after the indicator has processed the results.
+      self._VerbosePrint("Attempting to rerun test after failure.")
       self._MaybeRerun(pool, test)
     # Update the perf database if the test succeeded.
     return not has_unexpected_output
@@ -241,7 +243,9 @@ class Runner(object):
         if update_perf:
           self._RunPerfSafe(lambda: self.perfdata.UpdatePerfData(test))
     finally:
+      self._VerbosePrint("Closing process pool.")
       pool.terminate()
+      self._VerbosePrint("Closing database connection.")
       self._RunPerfSafe(lambda: self.perf_data_manager.close())
       if self.perf_failures:
         # Nuke perf data in case of failures. This might not work on windows as
@@ -254,6 +258,11 @@ class Runner(object):
     # Make sure that any allocations were printed in predictable mode.
     assert not self.context.predictable or self.printed_allocations
 
+  def _VerbosePrint(self, text):
+    if self.context.verbose:
+      print text
+      sys.stdout.flush()
+
   def GetCommand(self, test):
     d8testflag = []
     shell = test.suite.shell()
index 421f941..e40872f 100644 (file)
@@ -130,6 +130,7 @@ class VerboseProgressIndicator(SimpleProgressIndicator):
     else:
       outcome = 'pass'
     print 'Done running %s: %s' % (test.GetLabel(), outcome)
+    sys.stdout.flush()
 
   def Heartbeat(self):
     print 'Still working...'