[toranj] perform a subprocess.poll() on wpantund instance during init of nodes (#2901)

This allows the underlying wpantund process associated with a `Node`
instance to be executed while we are waiting for it to be initialized.
It also protects against any unexpected termination of an instance.
This change would help with speed of initialization of all nodes
mainly when there are many instances running in parallel.
This commit is contained in:
Abtin Keshavarzian
2018-07-20 12:41:24 -07:00
committed by Jonathan Hui
parent 8e28b626a9
commit ffc2b972ab
+3
View File
@@ -491,6 +491,9 @@ class Node(object):
start_time = time.time()
while True:
try:
node._wpantund_process.poll()
if node._wpantund_process.returncode is not None:
print 'Node {} wpantund instance has terminated unexpectedly'.format(node)
if disable_logs:
node.set(WPAN_OT_LOG_LEVEL, '0')
node.leave()