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: testing.T.Log panics when called after test completion #145

Closed
pohly opened this issue Jun 29, 2022 · 1 comment
Closed

testing: testing.T.Log panics when called after test completion #145

pohly opened this issue Jun 29, 2022 · 1 comment

Comments

@pohly
Copy link
Contributor

pohly commented Jun 29, 2022

testing.T.Log is not meant to be used anymore after the test for which the testing.T instance was created has returned. This affects tests which do not properly terminate all goroutines. While such tests ideally should get fixed, it may not be possible in all cases. For example, Kubernetes has several APIs which create goroutines without properly supporting cleanup.

It would be good to support safe usage of logr.testing also for such tests.

Found in Kubernetes for klog.ktesting, which is conceptually similar - see kubernetes/kubernetes#110811 for the original report and kubernetes/klog#337 for a potential solution.

@pohly
Copy link
Contributor Author

pohly commented Dec 8, 2022

As discussed in #168, panicking might be right for a broken test - let's close as "won't fix".

@pohly pohly closed this as completed Dec 8, 2022
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 a pull request may close this issue.

1 participant