Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the run_tests.py terminated with exception when timeout occurs. #3488

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion demos/tests/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,10 @@ def option_to_args(key, value):
execution_time = timeit.default_timer() - start_time
demo.parse_output(output, test_case, device)
except (subprocess.CalledProcessError, subprocess.TimeoutExpired) as e:
output = e.output
if type(e) == subprocess.TimeoutExpired:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's handled by elif isinstance(e, subprocess.TimeoutExpired): below

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. The exception found serval days ago can't be reproduced now. So Close this PR now.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failure appeared again as below caused by the timeout. I'm not sure if reopen this PR again? @Wovchena
image

output = e.output.decode('utf-8')
else:
output = e.output
if isinstance(e, subprocess.CalledProcessError):
exit_msg = f'Exit code: {e.returncode}\n'
elif isinstance(e, subprocess.TimeoutExpired):
Expand Down