Skip to content

Commit

Permalink
exception catch for bad volta initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
netort committed Mar 7, 2018
1 parent 54a32f4 commit 6b6d5dc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
8 changes: 6 additions & 2 deletions volta/core/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,12 @@ def end_test(self):
logger.info('Finishing test...')
if 'volta' in self.enabled_modules:
self.volta.end_test()
self.process_currents.close()
self.process_currents.join()
try:
self.process_currents.close()
except AttributeError:
logger.warn('Core has no process currents thread. Seems like VoltaBox initialization failed')
else:
self.process_currents.join()
if 'phone' in self.enabled_modules:
self.phone.end()
if self.events_parser:
Expand Down
9 changes: 7 additions & 2 deletions volta/providers/boxes/box_binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,12 @@ def end_test(self):
except AttributeError:
logger.warn('VoltaBox has no Reader. Seems like VoltaBox initialization failed')
logger.debug('VoltaBox has no Reader. Seems like VoltaBox initialization failed', exc_info=True)
self.pipeline.close()
self.pipeline.join(10)
try:
self.pipeline.close()
except AttributeError:
logger.warn('VoltaBox has no Pipeline. Seems like VoltaBox initialization failed')
else:
self.pipeline.join(10)
self.data_source.close()

def get_info(self):
Expand Down Expand Up @@ -156,6 +160,7 @@ def start_test(self, results):
self.pipeline.start()
logger.debug('Waiting grabber thread finish...')


class BoxBinaryReader(object):
"""
Read chunks from source, convert and return numpy.array
Expand Down

0 comments on commit 6b6d5dc

Please sign in to comment.