[test] Simplify progress indicators.

This removes the "AboutToRun" callback. It makes not much
sense as it is not actually called before a test is run,
but just before the results are retrieved from the results
queue. Therefore, from an information-value p-o-v it is
redundant to the "HasRun" callback.

This also reduces log size on the bots by 50%, in order to
reduce buildbot slowness, which is tied to the amount
of logs.

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

Cr-Commit-Position: refs/heads/master@{#35382}
This commit is contained in:
machenbach 2016-04-11 04:59:48 -07:00 committed by Commit bot
parent 7bf43670d5
commit af1f78b80e
3 changed files with 1 additions and 16 deletions

View File

@ -248,7 +248,6 @@ class Runner(object):
self.total += 1
def _ProcessTestNormal(self, test, result, pool):
self.indicator.AboutToRun(test)
test.output = result[1]
test.duration = result[2]
has_unexpected_output = test.suite.HasUnexpectedOutput(test)
@ -285,7 +284,6 @@ class Runner(object):
if test.run == 1 and result[1].HasTimedOut():
# If we get a timeout in the first run, we are already in an
# unpredictable state. Just report it as a failure and don't rerun.
self.indicator.AboutToRun(test)
test.output = result[1]
self.remaining -= 1
self.failed.append(test)
@ -294,16 +292,13 @@ class Runner(object):
# From the second run on, check for different allocations. If a
# difference is found, call the indicator twice to report both tests.
# All runs of each test are counted as one for the statistic.
self.indicator.AboutToRun(test)
self.remaining -= 1
self.failed.append(test)
self.indicator.HasRun(test, True)
self.indicator.AboutToRun(test)
test.output = result[1]
self.indicator.HasRun(test, True)
elif test.run >= 3:
# No difference on the third run -> report a success.
self.indicator.AboutToRun(test)
self.remaining -= 1
self.succeeded += 1
test.output = result[1]

View File

@ -54,9 +54,6 @@ class ProgressIndicator(object):
def Done(self):
pass
def AboutToRun(self, test):
pass
def HasRun(self, test, has_unexpected_output):
pass
@ -147,10 +144,6 @@ class SimpleProgressIndicator(ProgressIndicator):
class VerboseProgressIndicator(SimpleProgressIndicator):
def AboutToRun(self, test):
print 'Starting %s...' % test.GetLabel()
sys.stdout.flush()
def HasRun(self, test, has_unexpected_output):
if has_unexpected_output:
if test.output.HasCrashed():
@ -201,10 +194,8 @@ class CompactProgressIndicator(ProgressIndicator):
self.PrintProgress('Done')
print "" # Line break.
def AboutToRun(self, test):
self.PrintProgress(test.GetLabel())
def HasRun(self, test, has_unexpected_output):
self.PrintProgress(test.GetLabel())
if has_unexpected_output:
self.ClearLine(self.last_status_length)
self.PrintFailureHeader(test)

View File

@ -203,7 +203,6 @@ class NetworkedRunner(execution.Runner):
[constants.INFORM_DURATION, perf_key, test.duration,
self.context.arch, self.context.mode],
self.local_socket)
self.indicator.AboutToRun(test)
has_unexpected_output = test.suite.HasUnexpectedOutput(test)
if has_unexpected_output:
self.failed.append(test)