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

mh: gracefully handle exception in one of the skip callbacks #92

Merged
merged 2 commits into from
Oct 31, 2024

Conversation

pbrezina
Copy link
Contributor

@pbrezina pbrezina commented Oct 29, 2024

4baa3e2 (Pavel Březina, 33 minutes ago)
   mh: gracefully handle exception in one of the skip callbacks

   This will handle an exception inside skip callback nicely and stores logs
   inside skip.log inside a test.log.

49ba7c1 (Pavel Březina, 6 minutes ago)
   utils: clear state on exit

   Otherwise host utils will have lingering state from previous test runs.

If an error corrured insinde a skip callback, we got broken and attempted to call exit on utils that were not entered. The first commit avoids the condition to happen and the teardown is not run at all, which makes sense since we did not run setup. The second commit fixes the reason why we attempted to call exit to avoid it in other possible situations.

Reproducer:
https://github.com/pbrezina/sssd/tree/ci-exit

pytest --mh-config=mhc.yaml -k "test_passkey__check_tgt or test_passkey__ipa_server_offline" -vvv

This will handle an exception inside skip callback nicely and stores
logs inside skip.log inside a test.log.
Otherwise host utils will have lingering state from previous test runs.
Copy link
Contributor

@justin-stephenson justin-stephenson left a comment

Choose a reason for hiding this comment

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

Ack, thank you.

@pbrezina pbrezina merged commit 2c2969f into next-actions:master Oct 31, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants