Skip to content

Commit 35142b8

Browse files
kdsudacKenadia
authored andcommitted
giving PlugTeardownThreads names (#708)
1 parent c6210b3 commit 35142b8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

openhtf/plugs/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,16 +482,18 @@ def tear_down_plugs(self):
482482
self._xmlrpc_server = None
483483

484484
_LOG.debug('Tearing down all plugs.')
485-
for a_plug in self._plugs_by_type.values():
486-
thread = _PlugTearDownThread(a_plug)
485+
for plug_type, plug_instance in self._plugs_by_type.items():
486+
thread = _PlugTearDownThread(plug_instance,
487+
name='<PlugTearDownThread: %s>' % plug_type)
487488
thread.start()
488489
timeout_s = (conf.plug_teardown_timeout_s
489490
if conf.plug_teardown_timeout_s
490491
else None)
491492
thread.join(timeout_s)
492493
if thread.is_alive():
493494
thread.kill()
494-
_LOG.warning('Killed tearDown for plug %s after timeout.', a_plug)
495+
_LOG.warning('Killed tearDown for plug %s after timeout.',
496+
plug_instance)
495497
self._plugs_by_type.clear()
496498
self._plugs_by_name.clear()
497499

0 commit comments

Comments
 (0)