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

Commit

Permalink
Bug 848881 - Report throbberstop - throbberstart instead of total dra…
Browse files Browse the repository at this point in the history
…wing time, r=mcote.
  • Loading branch information
bclary committed Mar 9, 2013
1 parent ad33048 commit 779f702
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions tests/s1s2test.py
Expand Up @@ -58,7 +58,7 @@ def runjob(self, job, worker_subprocess):
# Get results - do this now so we don't have as much to # Get results - do this now so we don't have as much to
# parse in logcat. # parse in logcat.
self.logger.debug('analyzing logcat') self.logger.debug('analyzing logcat')
throbberstart, throbberstop, drawtime = self.analyze_logcat(job) throbberstart, throbberstop = self.analyze_logcat(job)


self.logger.debug('killing fennec') self.logger.debug('killing fennec')
# Get rid of the browser and session store files # Get rid of the browser and session store files
Expand All @@ -68,8 +68,6 @@ def runjob(self, job, worker_subprocess):
self.remove_sessionstore_files() self.remove_sessionstore_files()


# Ensure we succeeded - no 0's reported # Ensure we succeeded - no 0's reported
# - except drawtime, since enddrawing has been missing for
# some time.
if (throbberstart and if (throbberstart and
throbberstop and throbberstop and
starttime): starttime):
Expand All @@ -82,7 +80,6 @@ def runjob(self, job, worker_subprocess):
self.publish_results(starttime=int(starttime), self.publish_results(starttime=int(starttime),
tstrt=throbberstart, tstrt=throbberstart,
tstop=throbberstop, tstop=throbberstop,
drawing=drawtime,
job=job, job=job,
testname=testname) testname=testname)


Expand Down Expand Up @@ -136,25 +133,22 @@ def analyze_logcat(self, job):
buf = [x.strip('\r\n') for x in self.dm.getLogcat()] buf = [x.strip('\r\n') for x in self.dm.getLogcat()]
throbberstartRE = re.compile('.*Throbber start$') throbberstartRE = re.compile('.*Throbber start$')
throbberstopRE = re.compile('.*Throbber stop$') throbberstopRE = re.compile('.*Throbber stop$')
endDrawingRE = re.compile('.*endDrawing$')
throbstart = 0 throbstart = 0
throbstop = 0 throbstop = 0
enddraw = 0


for line in buf: for line in buf:
line = line.strip() line = line.strip()
# we want the first throbberstart and throbberstop but the *last* # we want the first throbberstart and throbberstop.
# enddrawing
if throbberstartRE.match(line) and not throbstart: if throbberstartRE.match(line) and not throbstart:
throbstart = line.split(' ')[-4] throbstart = line.split(' ')[-4]
elif throbberstopRE.match(line) and not throbstop: elif throbberstopRE.match(line) and not throbstop:
throbstop = line.split(' ')[-4] throbstop = line.split(' ')[-4]
elif endDrawingRE.match(line): if throbstart and throbstop:
enddraw = line.split(' ')[-3] break
return (int(throbstart), int(throbstop), int(enddraw)) return (int(throbstart), int(throbstop))


def publish_results(self, starttime=0, tstrt=0, tstop=0, drawing=0, job=None, testname = ''): def publish_results(self, starttime=0, tstrt=0, tstop=0, job=None, testname = ''):
msg = 'Start Time: %s Throbber Start: %s Throbber Stop: %s EndDraw: %s' % (starttime, tstrt, tstop, drawing) msg = 'Start Time: %s Throbber Start: %s Throbber Stop: %s' % (starttime, tstrt, tstop)
print 'RESULTS %s %s:%s' % (self.phone_cfg['phoneid'], datetime.datetime.fromtimestamp(int(job['blddate'])), msg) print 'RESULTS %s %s:%s' % (self.phone_cfg['phoneid'], datetime.datetime.fromtimestamp(int(job['blddate'])), msg)
self.logger.info('RESULTS: %s:%s' % (self.phone_cfg['phoneid'], msg)) self.logger.info('RESULTS: %s:%s' % (self.phone_cfg['phoneid'], msg))


Expand All @@ -165,7 +159,6 @@ def publish_results(self, starttime=0, tstrt=0, tstop=0, drawing=0, job=None, te
resultdata['starttime'] = starttime resultdata['starttime'] = starttime
resultdata['throbberstart'] = tstrt resultdata['throbberstart'] = tstrt
resultdata['throbberstop'] = tstop resultdata['throbberstop'] = tstop
resultdata['enddrawing'] = drawing
resultdata['blddate'] = job['blddate'] resultdata['blddate'] = job['blddate']


resultdata['revision'] = job['revision'] resultdata['revision'] = job['revision']
Expand Down

0 comments on commit 779f702

Please sign in to comment.