kubernetes/test/integration
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
..
apimachinery Clean shutdown of apimachinery integration tests 2022-06-14 13:55:31 +02:00
apiserver Merge pull request #115315 from enj/enj/i/kas_kubelet_conn_close 2023-02-07 07:01:14 -08:00
auth test/integration: Replace deprecated pointer function 2023-01-05 18:38:40 +01:00
authutil This introduces an Impersonate-Uid header to server side code. 2021-07-06 10:13:16 -07:00
benchmark io/ioutil has already been deprecated in golang 1.16, so replace all ioutil with io and os 2022-02-03 05:32:12 +08:00
certificates add superuser fallback to authorizer (#111558) 2022-10-18 18:57:00 -07:00
client Enable propagration of HasSynced 2022-12-14 18:43:33 +00:00
clustercidr Add integration tests for MultiCIDRRangeAllocator 2023-02-01 13:48:07 +00:00
configmap Clean shutdown of configmap integration tests 2022-05-26 17:19:36 +02:00
controlplane [KMSv2] Add metrics for grpc service 2023-02-09 18:51:37 +00:00
cronjob Clean shutdown of cronjob integration tests 2022-05-28 21:36:54 +02:00
daemonset Update daemonSet status even if syncDaemonSet fails 2022-12-10 11:45:56 +09:00
defaulttolerationseconds Clean shutdown of defaulttolerationseconds integration tests 2022-05-28 21:14:09 +02:00
deployment Clean shutdown of deployment integration tests 2022-05-26 17:19:36 +02:00
disruption Enable the feature into beta 2022-11-09 09:02:40 +01:00
dryrun Revert "add test to dry-run for unwanted generated values" 2022-04-06 12:34:49 -04:00
dualstack test dualstack services with assigned clusterIPs 2022-10-14 15:53:49 +00:00
endpoints Do not create endpoints if service of type ExternalName (#114814) 2023-01-18 03:12:34 -08:00
endpointslice endpointslicemirroring handle endpoints with multiple subsets 2022-12-10 11:44:10 +00:00
etcd apiserver: update serialization version priority for policy API 2023-01-19 14:42:26 +08:00
events Clean shutdown of events integration tests 2022-06-06 20:33:20 +02:00
evictions Merge pull request #113375 from atiratree/PodHealthyPolicy-api 2022-11-11 04:02:10 -08:00
examples Combine RequestAuditConfig with RequestAuditConfigWithLevel 2022-11-02 15:24:14 -07:00
framework test: use go-uber/goleak for strict leak checking 2023-02-14 12:11:37 +01:00
garbagecollector Remove //lint:ignore pragmas that aren't being used anymore 2021-11-17 08:56:54 +01:00
ipamperf Remove generated file rules in make 2022-10-04 08:50:30 -07:00
job Remove Legacy Job Tracking 2023-01-10 14:52:54 +00:00
kubelet Fix leaking goroutines in kubelet integration test 2022-05-23 11:50:29 +02:00
logs k8s.io/component-base/logs: allow overriding os.Stdout and os.Stderr 2023-01-17 10:25:57 +01:00
metrics Clean shutdown of metrics integration tests 2022-05-26 16:20:56 +02:00
namespace Clean shutdown of apply integration tests 2022-11-07 09:14:15 +01:00
network Fix panic on ClusterIP allocation for /28 subnets 2023-01-25 20:32:40 +00:00
node Enable the feature into beta 2022-11-09 09:02:40 +01:00
objectmeta Remove ClusterName 2022-05-05 20:12:50 +00:00
openshift part1 of e2e: master to apiserver/control-plane 2021-03-31 15:50:18 +08:00
podgc PodGC should not add DisruptionTarget condition for pods which are in terminal phase 2023-01-13 18:28:44 +01:00
pods Remove EphemeralContainers feature-gate checks 2022-07-26 02:55:30 +02:00
pvc Update AnyVolumeDataSource feature gate to beta 2022-03-29 13:39:48 -04:00
quota Generate and format files 2022-07-26 13:14:05 -04:00
replicaset clean up code 2022-07-15 20:22:37 +08:00
replicationcontroller clean up code 2022-07-15 20:22:37 +08:00
scale io/ioutil has already been deprecated in golang 1.16, so replace all ioutil with io and os 2022-02-03 05:32:12 +08:00
scheduler Distinguish unschedulable with unresolvable in scheduler 2023-01-05 16:59:19 +08:00
scheduler_perf Fix failure(context canceled) in scheduler_perf benchmark (#114843) 2023-01-30 16:21:00 -08:00
secrets Clean shutdown of secret integration tests 2022-05-26 17:19:36 +02:00
service test/integration: Replace deprecated pointer function 2023-01-05 18:38:40 +01:00
serviceaccount lock LegacyServiceAccountTokenNoAutoGeneration 2022-12-16 10:45:35 -08:00
serving remove unwanted newlines 2023-01-24 21:45:32 +01:00
statefulset Add integration tests for StatefulSetStartOrdinal feature (#115466) 2023-02-03 05:26:29 -08:00
storageclasses Clean shutdown of storageclasses integration tests 2022-05-26 17:19:36 +02:00
storageversion test/integration: Replace deprecated pointer function 2023-01-05 18:38:40 +01:00
tls hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
ttlcontroller Clean shutdown of ttlcontroller integration tests 2022-05-26 16:20:56 +02:00
util test/integration: fix Broadcaster leak 2023-02-01 12:42:50 +01:00
volume add integration tests for retroactive SC assignment 2022-08-09 15:22:38 +02:00
volumescheduling scheduler volumebinding: leverage PreFilterResult 2022-11-17 21:37:24 -08:00
.import-restrictions Make integration tests not depend on e2e tests 2021-03-25 23:02:52 +08:00
benchmark-controller.json Updating pause image refernces to 3.9 2022-11-14 10:24:54 -08:00
doc.go
utils.go Clean up the master term in test/integration comments 2021-06-18 16:31:05 +08:00