Skip to content
This repository has been archived by the owner on Aug 14, 2020. It is now read-only.

Commit

Permalink
Bug 1300892 - Autophone - do not treat S1S2 tests failure to get a si…
Browse files Browse the repository at this point in the history
…ngle measurement as a failure, r=jmaher
  • Loading branch information
bclary committed Sep 8, 2016
1 parent 3482725 commit 086707f
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions tests/s1s2test.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,6 @@ def run_job(self):
(attempt, self.stderrp_attempts,
testnum, testcount, iteration, url))

dataset.append({})

if not self.create_profile():
self.test_failure(url,
'TEST-UNEXPECTED-FAIL',
Expand All @@ -153,24 +151,18 @@ def run_job(self):
if measurement:
self.test_pass(url)
else:
self.test_failure(
url,
'TEST-UNEXPECTED-FAIL',
'Failed to get uncached measurement.',
PhoneTestResult.TESTFAILED)
self.loggerdeco.warning(
'%s Failed to get uncached measurement.' % url)
continue
dataset[-1]['uncached'] = measurement
success = True
dataset.append({'uncached': measurement})

measurement = self.runtest(url)
if measurement:
self.test_pass(url)
else:
self.test_failure(
url,
'TEST-UNEXPECTED-FAIL',
'Failed to get cached measurement.',
PhoneTestResult.TESTFAILED)
self.loggerdeco.warning(
'%s Failed to get cached measurement.' % url)
continue
dataset[-1]['cached'] = measurement

Expand All @@ -186,6 +178,18 @@ def run_job(self):

if command and command['interrupt']:
break
measurements = len(dataset)
if measurements > 0 and self._iterations - measurements > 1:
# Ignore a failure to get a single measurement
# but treat the case where we got at least one
# measurement but failed to get two or more
# measurements as a reportable failure.
self.test_failure(
url,
'TEST-UNEXPECTED-FAIL',
'Failed to get %s measurements' % (
self._iterations - measurements),
PhoneTestResult.TESTFAILED)
if not success:
# If we have not gotten a single measurement at this point,
# just bail and report the failure rather than wasting time
Expand Down

0 comments on commit 086707f

Please sign in to comment.