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

Add try - except to keep running the remaining tests #3448

Merged

Conversation

chuneuny-emily
Copy link
Contributor

Summary

How to test

Checklist

  • I have added unit tests to cover my changes.​
  • I have added integration tests to cover my changes.​
  • I have ran e2e tests and there is no issues.
  • I have added the description of my changes into CHANGELOG in my target branch (e.g., CHANGELOG in develop).​
  • I have updated the documentation in my target branch accordingly (e.g., documentation in develop).
  • I have linked related issues.

License

  • I submit my code changes under the same Apache License that covers the project.
    Feel free to contact the maintainers if that's a concern.
  • I have updated the license header for each file (see an example below).
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

Copy link
Contributor

@goodsong81 goodsong81 left a comment

Choose a reason for hiding this comment

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

Why don't you raise the first or last exception after the loop?
Then, the raw data would be collected anyway, and test results are marked as failed as well as intended.

last_exception = None
...
for seed in ...
    try:
        ...
    except Exception as e:
        last_exception = e
...
if last_exception is not None:
    raise last_exception

@chuneuny-emily
Copy link
Contributor Author

Why don't you raise the first or last exception after the loop? Then, the raw data would be collected anyway, and test results are marked as failed as well as intended.

last_exception = None
...
for seed in ...
    try:
        ...
    except Exception as e:
        last_exception = e
...
if last_exception is not None:
    raise last_exception

Initially I chose not to raise the errors and just print them because I thought that raising an exception would prevent the summary generation. Based on the feedback provided, I rethought our workflow (https://github.com/chuneuny-emily/training_extensions/blob/57aa6bd59f2c5f4ff32863a6367267dd0378ca8c/.github/workflows/perf_benchmark.yaml#L157). Generating an overall summary appears to be handled separately in another part of the workflow. So I've updated my code to now collect all exceptions and raise them after the loop completes.

@chuneuny-emily chuneuny-emily merged commit 434697d into openvinotoolkit:develop May 7, 2024
13 checks passed
@chuneuny-emily chuneuny-emily deleted the emily/update-benchmark branch May 7, 2024 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TEST Any changes in tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants