Commit af1f78b8 authored by machenbach's avatar machenbach Committed by Commit bot

[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}
parent 7bf43670
...@@ -248,7 +248,6 @@ class Runner(object): ...@@ -248,7 +248,6 @@ class Runner(object):
self.total += 1 self.total += 1
def _ProcessTestNormal(self, test, result, pool): def _ProcessTestNormal(self, test, result, pool):
self.indicator.AboutToRun(test)
test.output = result[1] test.output = result[1]
test.duration = result[2] test.duration = result[2]
has_unexpected_output = test.suite.HasUnexpectedOutput(test) has_unexpected_output = test.suite.HasUnexpectedOutput(test)
...@@ -285,7 +284,6 @@ class Runner(object): ...@@ -285,7 +284,6 @@ class Runner(object):
if test.run == 1 and result[1].HasTimedOut(): if test.run == 1 and result[1].HasTimedOut():
# If we get a timeout in the first run, we are already in an # 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. # unpredictable state. Just report it as a failure and don't rerun.
self.indicator.AboutToRun(test)
test.output = result[1] test.output = result[1]
self.remaining -= 1 self.remaining -= 1
self.failed.append(test) self.failed.append(test)
...@@ -294,16 +292,13 @@ class Runner(object): ...@@ -294,16 +292,13 @@ class Runner(object):
# From the second run on, check for different allocations. If a # From the second run on, check for different allocations. If a
# difference is found, call the indicator twice to report both tests. # difference is found, call the indicator twice to report both tests.
# All runs of each test are counted as one for the statistic. # All runs of each test are counted as one for the statistic.
self.indicator.AboutToRun(test)
self.remaining -= 1 self.remaining -= 1
self.failed.append(test) self.failed.append(test)
self.indicator.HasRun(test, True) self.indicator.HasRun(test, True)
self.indicator.AboutToRun(test)
test.output = result[1] test.output = result[1]
self.indicator.HasRun(test, True) self.indicator.HasRun(test, True)
elif test.run >= 3: elif test.run >= 3:
# No difference on the third run -> report a success. # No difference on the third run -> report a success.
self.indicator.AboutToRun(test)
self.remaining -= 1 self.remaining -= 1
self.succeeded += 1 self.succeeded += 1
test.output = result[1] test.output = result[1]
......
...@@ -54,9 +54,6 @@ class ProgressIndicator(object): ...@@ -54,9 +54,6 @@ class ProgressIndicator(object):
def Done(self): def Done(self):
pass pass
def AboutToRun(self, test):
pass
def HasRun(self, test, has_unexpected_output): def HasRun(self, test, has_unexpected_output):
pass pass
...@@ -147,10 +144,6 @@ class SimpleProgressIndicator(ProgressIndicator): ...@@ -147,10 +144,6 @@ class SimpleProgressIndicator(ProgressIndicator):
class VerboseProgressIndicator(SimpleProgressIndicator): class VerboseProgressIndicator(SimpleProgressIndicator):
def AboutToRun(self, test):
print 'Starting %s...' % test.GetLabel()
sys.stdout.flush()
def HasRun(self, test, has_unexpected_output): def HasRun(self, test, has_unexpected_output):
if has_unexpected_output: if has_unexpected_output:
if test.output.HasCrashed(): if test.output.HasCrashed():
...@@ -201,10 +194,8 @@ class CompactProgressIndicator(ProgressIndicator): ...@@ -201,10 +194,8 @@ class CompactProgressIndicator(ProgressIndicator):
self.PrintProgress('Done') self.PrintProgress('Done')
print "" # Line break. print "" # Line break.
def AboutToRun(self, test):
self.PrintProgress(test.GetLabel())
def HasRun(self, test, has_unexpected_output): def HasRun(self, test, has_unexpected_output):
self.PrintProgress(test.GetLabel())
if has_unexpected_output: if has_unexpected_output:
self.ClearLine(self.last_status_length) self.ClearLine(self.last_status_length)
self.PrintFailureHeader(test) self.PrintFailureHeader(test)
......
...@@ -203,7 +203,6 @@ class NetworkedRunner(execution.Runner): ...@@ -203,7 +203,6 @@ class NetworkedRunner(execution.Runner):
[constants.INFORM_DURATION, perf_key, test.duration, [constants.INFORM_DURATION, perf_key, test.duration,
self.context.arch, self.context.mode], self.context.arch, self.context.mode],
self.local_socket) self.local_socket)
self.indicator.AboutToRun(test)
has_unexpected_output = test.suite.HasUnexpectedOutput(test) has_unexpected_output = test.suite.HasUnexpectedOutput(test)
if has_unexpected_output: if has_unexpected_output:
self.failed.append(test) self.failed.append(test)
......
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