kubernetes/vendor/go.uber.org/goleak/CHANGELOG.md
Patrick Ohly f131cabfa0 test: use go-uber/goleak for strict leak checking
It provides more readable output and has additional APIs for using it inside a
unit test. goleak.IgnoreCurrent is needed to filter out the goroutine that gets
started when importing go.opencensus.io/stats/view.

In order to handle background goroutines that get created on demand and cannot
be stopped (like the one for LogzHealth), a helper function ensures that those
are running before calling goleak.IgnoreCurrent. Keeping those goroutines
running is not a problem and thus not worth the effort of adding new APIs to
stop them.

Other goroutines are genuine leaks for which no fix is available. Those get
suppressed via IgnoreTopFunction, which works as long as that function
is unique enough.

Example output for the leak fixed in https://github.com/kubernetes/kubernetes/pull/115423:

    E0202 09:30:51.641841   74789 etcd.go:205] "EtcdMain goroutine check" err=<
        found unexpected goroutines:
        [Goroutine 4889 in state chan receive, with k8s.io/apimachinery/pkg/watch.(*Broadcaster).loop on top of the stack:
        goroutine 4889 [chan receive]:
        k8s.io/apimachinery/pkg/watch.(*Broadcaster).loop(0xc0076183c0)
        	/nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/watch/mux.go:268 +0x65
        created by k8s.io/apimachinery/pkg/watch.NewBroadcaster
        	/nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/watch/mux.go:77 +0x116
    >
2023-02-14 12:11:37 +01:00

1.7 KiB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

1.2.1

Changed

  • Drop golang/x/lint dependency.

1.2.0

Added

  • Add Cleanup option that can be used for registering cleanup callbacks. (#78)

Changed

  • Mark VerifyNone as a test helper. (#75)

Thanks to @tallclair for their contribution to this release.

1.1.12

Fixed

  • Fixed logic for ignoring trace related goroutines on Go versions 1.16 and above.

1.1.11

Fixed

  • Documentation fix on how to test.
  • Update dependency on stretchr/testify to v1.7.0. (#59)
  • Update dependency on golang.org/x/tools to address CVE-2020-14040. (#62)

1.1.10

Added

  • #49: Add option to ignore current goroutines, which checks for any additional leaks and allows for incremental adoption of goleak in larger projects.

Thanks to @denis-tingajkin for their contributions to this release.

1.0.0

Changed

  • Migrate to Go modules.

Fixed

  • Ignore trace related goroutines that cause false positives with -trace.

0.10.0

  • Initial release.