Skip to content

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

Closed
@pohly

Description

@pohly

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions