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

testing framework: implement panic handling #33525

Merged
merged 2 commits into from
Jul 19, 2023

Conversation

liamcervante
Copy link
Member

This PR just adds the default logging.PanicHandler() into the go routines started by the testing framework.

I was going to add some complex panic handling, where if a given test panics then the whole test command won't fail but just the current test case. Then the rest of the test cases could finish executing safely.

However, these test cases aren't like testing programming languages in which panics are expected, and something that the writer of the tests should go and fix. In Terraform panics are always bad, they're not something the user can recover from, and not something they should expect and have to deal with. If Terraform panics, they need to file a bug with us. This is all to point to the conclusion that we don't need to recover from panics in this way, it's not something the users should ever see and if they do, skipping it and carrying on isn't the right thing to do anyway. We want to make it annoying for them so they'll come and tell us and we can fix.

@liamcervante liamcervante requested a review from a team July 14, 2023 08:58
@liamcervante liamcervante merged commit 2cc81cf into main Jul 19, 2023
4 checks passed
@liamcervante liamcervante deleted the liamcervante/tests/panics branch July 19, 2023 07:57
@github-actions
Copy link

Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch.

Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants