scripts: twister: output error message
Sometimes custom script fails, but we can't see the error information in twister log, because the twister uses _ to ignore the stderr. Signed-off-by: Jingru Wang <jingru@synopsys.com>
This commit is contained in:
parent
7017678ffb
commit
eb614e268c
1 changed files with 3 additions and 1 deletions
|
@ -723,8 +723,10 @@ class DeviceHandler(Handler):
|
|||
def run_custom_script(script, timeout):
|
||||
with subprocess.Popen(script, stderr=subprocess.PIPE, stdout=subprocess.PIPE) as proc:
|
||||
try:
|
||||
stdout, _ = proc.communicate(timeout=timeout)
|
||||
stdout, stderr = proc.communicate(timeout=timeout)
|
||||
logger.debug(stdout.decode())
|
||||
if proc.returncode != 0:
|
||||
logger.error(f"Custom script failure: {stderr.decode(errors='ignore')}")
|
||||
|
||||
except subprocess.TimeoutExpired:
|
||||
proc.kill()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue