Fix the run_tests.py terminated with exception when timeout occurs.#3488
Conversation
Signed-off-by: Wang, Yang <yang4.wang@intel.com>
demos/tests/run_tests.py
Outdated
There was a problem hiding this comment.
I think it's handled by elif isinstance(e, subprocess.TimeoutExpired): below
There was a problem hiding this comment.
Yes. The exception found serval days ago can't be reproduced now. So Close this PR now.
There was a problem hiding this comment.
Failure appeared again as below caused by the timeout. I'm not sure if reopen this PR again? @Wovchena

|
Can't reproduced now. |
| exit_msg = f'Command timed out after {e.timeout} seconds\n' | ||
| output += exit_msg | ||
| print(output) | ||
| print('{}\n{}'.format(output, exit_msg)) |
There was a problem hiding this comment.
output var is used to save log file below: write_log(output, args.log_file). So you need this output += exit_msg.
If I understand correctly, TimeoutExpired.output is of bytes type for you. Maybe you can cast it to str before that +=
Please, add a comment to code with link to a bug https://bugs.python.org/issue43431 to explain why we have such cast.
There was a problem hiding this comment.
If I understand correctly,
TimeoutExpired.outputis of bytes type for you. Maybe you can cast it to str before that+=
Yes, you are right. output var is bytes type under that host env when timeout happened. While don't know why the output is Str type on my host when timeout happened.
There was a problem hiding this comment.
Check the bug. It appears on python3.8+ may be you have python3.7 or 3.6 on your host
Fix the run_tests.py terminated with exception when timeout occurs.
Signed-off-by: Wang, Yang yang4.wang@intel.com