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

Commit

Permalink
Bug 1161631 - Autophone - fix possible uninitialized PhoneTest.start_…
Browse files Browse the repository at this point in the history
…time due to device timeout in self.dm, r=gbrown.
  • Loading branch information
bclary committed Jun 1, 2015
1 parent 0f03d7f commit 0fcbbd3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions phonetest.py
Expand Up @@ -369,11 +369,8 @@ def handle_crashes(self):
self.loggerdeco.warning('Unknown error reason: %s' % error['reason'])

def setup_job(self):
self.logger_original = self.logger
self.loggerdeco_original = self.loggerdeco
self.dm_logger_original = self.dm._logger
self.start_time = datetime.datetime.now()
self.stop_time = None
self.stop_time = self.start_time
# Clear the Treeherder job details.
self.job_details = []
# Clear the log file if we are submitting logs to Treeherder.
Expand All @@ -388,6 +385,11 @@ def setup_job(self):
self.build.revision_hash,
tests=[self])

self.logger_original = self.logger
self.loggerdeco_original = self.loggerdeco
# self.dm._logger can raise ADBTimeoutError due to the
# property dm therefore place it after the initialization.
self.dm_logger_original = self.dm._logger
self.logger = logging.getLogger('autophone.worker.subprocess.test')
self.loggerdeco = LogDecorator(self.logger,
{'phoneid': self.phone.id,
Expand Down

0 comments on commit 0fcbbd3

Please sign in to comment.