sanitycheck: close pipe file handles

Make sure we close the pipe file handles after we are done, otherwise we
will end up with too many open file descriptors and crash...

Fixes #20974
Fixes #21637

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2020-01-03 16:29:46 -05:00
commit bdffb88950

View file

@ -812,12 +812,15 @@ class DeviceHandler(Handler):
t.join(self.timeout)
if t.is_alive():
logger.debug("Timed out")
logger.debug("Timed out while monitoring serial output on {}".format(self.instance.platform.name))
out_state = "timeout"
if ser.isOpen():
ser.close()
os.close(write_pipe)
os.close(read_pipe)
handler_time = time.time() - start_time
if out_state == "timeout":