diff --git a/assets/test/templates/common/function.tmpl b/assets/test/templates/common/function.tmpl index f852e71c05..db2eac3418 100644 --- a/assets/test/templates/common/function.tmpl +++ b/assets/test/templates/common/function.tmpl @@ -2,11 +2,12 @@ {{- $f := . }} func {{ .TestName }}(t *testing.T) { + t.Parallel() {{- if .TestParameters }} type args struct { - {{- range .TestParameters }} - {{ Param . }} {{ .Type }} - {{- end}} + {{- range .TestParameters }} + {{ Param . }} {{ .Type }} + {{- end}} } {{- end }} {{- $hasFields := false -}} @@ -109,6 +110,7 @@ func {{ .TestName }}(t *testing.T) { for {{- if (or .Subtests (not .IsNaked)) }} _, test := {{- end }} range tests { {{- if .Subtests }} t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc({{- if .TestParameters }} test.args {{- end }}) diff --git a/assets/test/templates/common/header.tmpl b/assets/test/templates/common/header.tmpl index 7426cd65e2..fea59430b6 100644 --- a/assets/test/templates/common/header.tmpl +++ b/assets/test/templates/common/header.tmpl @@ -4,7 +4,7 @@ package {{.Package}} import ( - "go.uber.org/goleak" + "go.uber.org/goleak" {{range .Imports}}{{.Name}} {{.Path}} {{end}} ) diff --git a/assets/test/templates/option/function.tmpl b/assets/test/templates/option/function.tmpl index ff4876f934..b094ff3e00 100644 --- a/assets/test/templates/option/function.tmpl +++ b/assets/test/templates/option/function.tmpl @@ -2,6 +2,7 @@ {{- $f := . }} func {{ .TestName }}(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} {{- if .TestParameters }} @@ -118,6 +119,7 @@ func {{ .TestName }}(t *testing.T) { for {{- if (or .Subtests (not .IsNaked)) }} _, test := {{- end }} range tests { {{- if .Subtests }} t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc({{- if .TestParameters }} test.args {{- end }}) diff --git a/go.mod b/go.mod index 7a7e7b388a..ac99a7fc22 100755 --- a/go.mod +++ b/go.mod @@ -9,45 +9,45 @@ replace ( github.com/coreos/etcd => go.etcd.io/etcd v0.5.0-alpha.5.0.20200425165423-262c93980547 github.com/docker/docker => github.com/moby/moby v17.12.0-ce-rc1.0.20200618181300-9dc6525e6118+incompatible github.com/envoyproxy/protoc-gen-validate => github.com/envoyproxy/protoc-gen-validate v0.4.0 - github.com/go-sql-driver/mysql => github.com/go-sql-driver/mysql v1.5.1-0.20200531100419-12508c83901b + github.com/go-sql-driver/mysql => github.com/go-sql-driver/mysql v1.5.1-0.20200720071143-73dc904a9ece github.com/gocql/gocql => github.com/gocql/gocql v0.0.0-20200624222514-34081eda590e github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.1 github.com/gophercloud/gophercloud => github.com/gophercloud/gophercloud v0.12.0 github.com/gorilla/mux => github.com/gorilla/mux v1.7.5-0.20200711200521-98cb6bf42e08 github.com/gorilla/websocket => github.com/gorilla/websocket v1.4.2 github.com/tensorflow/tensorflow => github.com/tensorflow/tensorflow v2.1.0+incompatible - golang.org/x/crypto => golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899 - k8s.io/api => k8s.io/api v0.18.5 - k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.18.5 - k8s.io/apimachinery => k8s.io/apimachinery v0.18.5 - k8s.io/client-go => k8s.io/client-go v0.18.5 + golang.org/x/crypto => golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de + k8s.io/api => k8s.io/api v0.18.6 + k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.18.6 + k8s.io/apimachinery => k8s.io/apimachinery v0.18.6 + k8s.io/client-go => k8s.io/client-go v0.18.6 sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.6.1 ) require ( - cloud.google.com/go v0.61.1-0.20200714003224-fb3791807bf8 + cloud.google.com/go v0.61.1-0.20200728180147-901261277e25 code.cloudfoundry.org/bytefmt v0.0.0-20200131002437-cf55d5288a48 - contrib.go.opencensus.io/exporter/jaeger v0.2.0 + contrib.go.opencensus.io/exporter/jaeger v0.2.1 contrib.go.opencensus.io/exporter/prometheus v0.2.1-0.20200609204449-6bcf6f8577f0 contrib.go.opencensus.io/exporter/stackdriver v0.13.2 - github.com/aws/aws-sdk-go v1.33.5 + github.com/aws/aws-sdk-go v1.33.14 github.com/cespare/xxhash/v2 v2.1.1 github.com/cockroachdb/errors v1.5.1-0.20200617111016-cc0024f9c4d3 github.com/danielvladco/go-proto-gql/pb v0.6.1 - github.com/envoyproxy/protoc-gen-validate v0.4.1-0.20200708173139-ef00e9c655af + github.com/envoyproxy/protoc-gen-validate v0.4.1-0.20200715145404-de7329c341d6 github.com/fsnotify/fsnotify v1.4.10-0.20200417215612-7f4cf4dd2b52 github.com/go-redis/redis/v7 v7.2.1-0.20200519055202-64bb0b7f3af4 - github.com/go-sql-driver/mysql v1.5.1-0.20200531100419-12508c83901b + github.com/go-sql-driver/mysql v1.5.1-0.20200720071143-73dc904a9ece github.com/gocql/gocql v0.0.0-20200131111108-92af2e088537 github.com/gocraft/dbr/v2 v2.7.1-0.20200218045517-f487ccffc6d0 github.com/gogo/protobuf v1.3.1 - github.com/google/go-cmp v0.5.1-0.20200622165317-d669b046d122 + github.com/google/go-cmp v0.5.1 github.com/google/gofuzz v1.1.0 github.com/gorilla/mux v1.7.5-0.20200711200521-98cb6bf42e08 github.com/hashicorp/go-version v1.2.1 - github.com/json-iterator/go v1.1.10 - github.com/klauspost/compress v1.10.11-0.20200702095008-b084a35fc841 - github.com/kpango/fastime v1.0.17-0.20200709224505-05105e51a69a + github.com/json-iterator/go v1.1.11-0.20200721090723-5bce16d299eb + github.com/klauspost/compress v1.10.11-0.20200722091917-f5e4a2eee1f8 + github.com/kpango/fastime v1.0.17-0.20200719090826-d1de9e8e3c85 github.com/kpango/fuid v0.0.0-20190507064958-80435564606b github.com/kpango/gache v1.2.2-0.20200709224359-34beea72198c github.com/kpango/glg v1.5.2-0.20200624074227-79f879e27c67 @@ -57,20 +57,20 @@ require ( github.com/tensorflow/tensorflow v0.0.0-00010101000000-000000000000 github.com/yahoojapan/gongt v0.0.0-20190517050727-966dcc7aa5e8 github.com/yahoojapan/ngtd v0.0.0-20200424071638-9872bbae3700 - go.opencensus.io v0.22.5-0.20200705234159-8e242ede942b + go.opencensus.io v0.22.5-0.20200719225510-d7677d6af595 go.uber.org/automaxprocs v1.3.1-0.20200415073007-b685be8c1c23 - go.uber.org/goleak v1.0.1-0.20200504231054-4eaa85786836 + go.uber.org/goleak v1.1.10 golang.org/x/net v0.0.0-20200707034311-ab3426394381 golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae gonum.org/v1/hdf5 v0.0.0-20200504100616-496fefe91614 gonum.org/v1/plot v0.7.1-0.20200701071522-4260761de856 - google.golang.org/api v0.29.1-0.20200713143821-1f1c055f7333 - google.golang.org/genproto v0.0.0-20200711021454-869866162049 - google.golang.org/grpc v1.31.0-dev.0.20200709232328-d8193ee9cc3e + google.golang.org/api v0.29.1-0.20200728133301-9fba589c08a5 + google.golang.org/genproto v0.0.0-20200728010541-3dc8dca74b7b + google.golang.org/grpc v1.32.0-dev.0.20200728194956-1c32b02682df gopkg.in/yaml.v2 v2.3.0 - k8s.io/api v0.18.5 - k8s.io/apimachinery v0.18.5 - k8s.io/client-go v0.18.5 - k8s.io/metrics v0.18.5 + k8s.io/api v0.18.6 + k8s.io/apimachinery v0.18.6 + k8s.io/client-go v0.18.6 + k8s.io/metrics v0.18.6 sigs.k8s.io/controller-runtime v0.0.0-00010101000000-000000000000 ) diff --git a/go.sum b/go.sum index 7731dbdb8c..39691e53c7 100644 --- a/go.sum +++ b/go.sum @@ -12,8 +12,8 @@ cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bP cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= cloud.google.com/go v0.60.0/go.mod h1:yw2G51M9IfRboUH61Us8GqCeF1PzPblB823Mn2q2eAU= -cloud.google.com/go v0.61.1-0.20200714003224-fb3791807bf8 h1:RRIBFTY9/cJuhg5Ozn7axG+LW76tLPGxZtO2ls/ypZg= -cloud.google.com/go v0.61.1-0.20200714003224-fb3791807bf8/go.mod h1:XukKJg4Y7QsUu0Hxg3qQKUWR4VuWivmyMK2+rUyxAqw= +cloud.google.com/go v0.61.1-0.20200728180147-901261277e25 h1:yUtYMoVpLurW/ROeGtDq+OU9sDKbHPfs9TyDJSeMUtE= +cloud.google.com/go v0.61.1-0.20200728180147-901261277e25/go.mod h1:yoeWHqqJEcpIeDmnbnOqxbRK4H6yvjuKc+fkHHPnW6A= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -35,8 +35,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 code.cloudfoundry.org/bytefmt v0.0.0-20190710193110-1eb035ffe2b6/go.mod h1:wN/zk7mhREp/oviagqUXY3EwuHhWyOvAdsn5Y4CzOrc= code.cloudfoundry.org/bytefmt v0.0.0-20200131002437-cf55d5288a48 h1:/EMHruHCFXR9xClkGV/t0rmHrdhX4+trQUcBqjwc9xE= code.cloudfoundry.org/bytefmt v0.0.0-20200131002437-cf55d5288a48/go.mod h1:wN/zk7mhREp/oviagqUXY3EwuHhWyOvAdsn5Y4CzOrc= -contrib.go.opencensus.io/exporter/jaeger v0.2.0 h1:nhTv/Ry3lGmqbJ/JGvCjWxBl5ozRfqo86Ngz59UAlfk= -contrib.go.opencensus.io/exporter/jaeger v0.2.0/go.mod h1:ukdzwIYYHgZ7QYtwVFQUjiT28BJHiMhTERo32s6qVgM= +contrib.go.opencensus.io/exporter/jaeger v0.2.1 h1:yGBYzYMewVL0yO9qqJv3Z5+IRhPdU7e9o/2oKpX4YvI= +contrib.go.opencensus.io/exporter/jaeger v0.2.1/go.mod h1:Y8IsLgdxqh1QxYxPC5IgXVmBaeLUeQFfBeBi9PbeZd0= contrib.go.opencensus.io/exporter/prometheus v0.2.1-0.20200609204449-6bcf6f8577f0 h1:2O3c1g5CzMc1+Uah4Waot9Obm0yw70VXJzWaP6Fz3nw= contrib.go.opencensus.io/exporter/prometheus v0.2.1-0.20200609204449-6bcf6f8577f0/go.mod h1:MjHoxkI7Ny27toPeFkRbXbzVjzIGkwOAptrAy8Mxtm8= contrib.go.opencensus.io/exporter/stackdriver v0.13.2 h1:5lKLBwUuq4S6pTbYaBtWmnay3eJfKNS3qL8M8HM5fM4= @@ -83,8 +83,8 @@ github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5 github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/aws/aws-sdk-go v1.23.20/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.33.5 h1:p2fr1ryvNTU6avUWLI+/H7FGv0TBIjzVM5WDgXBBv4U= -github.com/aws/aws-sdk-go v1.33.5/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= +github.com/aws/aws-sdk-go v1.33.14 h1:ucjyVEvtIdtn4acf+RKsgk6ybAYeMLXpGZeqoVvi7Kk= +github.com/aws/aws-sdk-go v1.33.14/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -241,8 +241,8 @@ github.com/go-redis/redis v6.15.2+incompatible h1:9SpNVG76gr6InJGxoZ6IuuxaCOQwDA github.com/go-redis/redis v6.15.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-redis/redis/v7 v7.2.1-0.20200519055202-64bb0b7f3af4 h1:zkLDRfY0KZEbWLotNP/YDHccK2bqpFaS99sTil9pmc8= github.com/go-redis/redis/v7 v7.2.1-0.20200519055202-64bb0b7f3af4/go.mod h1:JDNMw23GTyLNC4GZu9njt15ctBQVn7xjRfnwdHj/Dcg= -github.com/go-sql-driver/mysql v1.5.1-0.20200531100419-12508c83901b h1:teTnm0cMFHQlmo9fXbGDgH6RVoNDxmwMsL5TvawFnLc= -github.com/go-sql-driver/mysql v1.5.1-0.20200531100419-12508c83901b/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-sql-driver/mysql v1.5.1-0.20200720071143-73dc904a9ece h1:q/X4KeYkE2+1JHatu/TRIAke7m5ibks422AH9JdDXPk= +github.com/go-sql-driver/mysql v1.5.1-0.20200720071143-73dc904a9ece/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= @@ -301,8 +301,8 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1-0.20200622165317-d669b046d122 h1:eeWGCYIzX8WMLix4zugjdhcjxjjTaWdg4zYKQ2E8SF0= -github.com/google/go-cmp v0.5.1-0.20200622165317-d669b046d122/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -375,8 +375,9 @@ github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCV github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11-0.20200721090723-5bce16d299eb h1:NdZvQWEVSFydv4DDYmfIIInNITqLIgEGDQ/DkfrTv/A= +github.com/json-iterator/go v1.1.11-0.20200721090723-5bce16d299eb/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= @@ -398,16 +399,16 @@ github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQL github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.9.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.10.11-0.20200702095008-b084a35fc841 h1:FGkFtaPqHYCPbCV70I/rUR9h29E6QaoCrxkFX3Qp+Ic= -github.com/klauspost/compress v1.10.11-0.20200702095008-b084a35fc841/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/compress v1.10.11-0.20200722091917-f5e4a2eee1f8 h1:nrviUMsXBB+x22SeMTGI4aw71Vl4vkVOnPM121lkHKc= +github.com/klauspost/compress v1.10.11-0.20200722091917-f5e4a2eee1f8/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kpango/fastime v1.0.8/go.mod h1:Y5XY5bLG5yc7g2XmMUzc22XYV1XaH+KgUOHkDvLp4SA= github.com/kpango/fastime v1.0.9/go.mod h1:lVqUTcXmQnk1wriyvq5DElbRSRDC0XtqbXQRdz0Eo+g= github.com/kpango/fastime v1.0.16/go.mod h1:lVqUTcXmQnk1wriyvq5DElbRSRDC0XtqbXQRdz0Eo+g= -github.com/kpango/fastime v1.0.17-0.20200709224505-05105e51a69a h1:X+c5DrhTKn2dUXQgZPCSogm0PUkUUlQ0Ywz4iiSexrE= -github.com/kpango/fastime v1.0.17-0.20200709224505-05105e51a69a/go.mod h1:lVqUTcXmQnk1wriyvq5DElbRSRDC0XtqbXQRdz0Eo+g= +github.com/kpango/fastime v1.0.17-0.20200719090826-d1de9e8e3c85 h1:U+gNo2YTq+08DN/VcwtcCXg9davLeP7hD625o2tkhl4= +github.com/kpango/fastime v1.0.17-0.20200719090826-d1de9e8e3c85/go.mod h1:lVqUTcXmQnk1wriyvq5DElbRSRDC0XtqbXQRdz0Eo+g= github.com/kpango/fuid v0.0.0-20190507064958-80435564606b h1:aKayzSHGAeew3RHbcHPzva2hWX7p9M2L3ZhvqzLFHoM= github.com/kpango/fuid v0.0.0-20190507064958-80435564606b/go.mod h1:daBIyhkrFS6U/7vPRxeQ6pZWmqLKlwqJwsoPzei2YwU= github.com/kpango/gache v1.2.2-0.20200709224359-34beea72198c h1:Ap+4+v2QiMkdN3bBif0fAQ8uTrLCrkBGOFYW3O+A6Qs= @@ -581,8 +582,8 @@ github.com/tensorflow/tensorflow v2.1.0+incompatible h1:piL4AzfPuv67+gbsKo2IhIec github.com/tensorflow/tensorflow v2.1.0+incompatible/go.mod h1:itOSERT4trABok4UOoG+X4BoKds9F3rIsySdn+Lvu90= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/uber/jaeger-client-go v2.15.0+incompatible h1:NP3qsSqNxh8VYr956ur1N/1C1PjvOJnJykCzcD5QHbk= -github.com/uber/jaeger-client-go v2.15.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= +github.com/uber/jaeger-client-go v2.25.0+incompatible h1:IxcNZ7WRY1Y3G4poYlx24szfsn/3LvK9QHCq9oQw8+U= +github.com/uber/jaeger-client-go v2.25.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= @@ -624,8 +625,8 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4-0.20200608061201-1901b56b9515/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5-0.20200705234159-8e242ede942b h1:mnszvYEY3mtnj5bbnRTAGPbOmCnf4H2XbRsrIchKwvg= -go.opencensus.io v0.22.5-0.20200705234159-8e242ede942b/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5-0.20200719225510-d7677d6af595 h1:myTc5rmCJ/LuW4iwHN8Jp9PofJyPL1pqJhSEYmZgCOg= +go.opencensus.io v0.22.5-0.20200719225510-d7677d6af595/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -633,8 +634,8 @@ go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/automaxprocs v1.3.1-0.20200415073007-b685be8c1c23 h1:8RImc659VjmSXh90Yv3xmN6JhIphK4CqO1Uog6Jkw1M= go.uber.org/automaxprocs v1.3.1-0.20200415073007-b685be8c1c23/go.mod h1:9CWT6lKIep8U41DDaPiH6eFscnTyjfTANNQNx6LrIcA= -go.uber.org/goleak v1.0.1-0.20200504231054-4eaa85786836 h1:kus9vs4HUinDRm4yyugDiqij9yqn90590B9R49msj+w= -go.uber.org/goleak v1.0.1-0.20200504231054-4eaa85786836/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/goleak v1.1.10 h1:z+mqJhf6ss6BSfSM671tgKyZBFPTTJM+HLxnhPC3wu0= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= @@ -646,8 +647,8 @@ go.uber.org/zap v1.14.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.15.0 h1:ZZCA22JRF2gQE5FoNmhmrf7jeJJ2uhqDUNRYKm8dvmM= go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= -golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899 h1:DZhuSZLsGlFL4CmhA8BcRA0mnthyA/nZ00AqCUo7vHg= -golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de h1:ikNHVSjEfnvz6sxdSPCaPt572qowuyMDMJLLm3Db3ig= +golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -863,8 +864,9 @@ golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200522201501-cb1345f3a375/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200626171337-aa94e735be7f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200713011307-fd294ab11aed h1:+qzWo37K31KxduIYaBeMqJ8MUOyTayOQKpH9aDPLMSY= golang.org/x/tools v0.0.0-20200713011307-fd294ab11aed/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200727233628-55644ead90ce h1:HEwYEPqqa3/M0N2Q6IgtBaf2CaxvmRiVdAhX6LR7uE4= +golang.org/x/tools v0.0.0-20200727233628-55644ead90ce/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= @@ -898,8 +900,8 @@ google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/ google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.29.1-0.20200713143821-1f1c055f7333 h1:dIbORj4ACaFqeQjgyYX16E9676E+IdLUKQXLtti1JEs= -google.golang.org/api v0.29.1-0.20200713143821-1f1c055f7333/go.mod h1:CMyv3hc8Av5eDsJLHElfVAycOD2RszcKtehjVtcXkig= +google.golang.org/api v0.29.1-0.20200728133301-9fba589c08a5 h1:KCeEGFZmvhnqzRQS678WdRApdCP22gLgFJTJqA1PGlo= +google.golang.org/api v0.29.1-0.20200728133301-9fba589c08a5/go.mod h1:CMyv3hc8Av5eDsJLHElfVAycOD2RszcKtehjVtcXkig= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -936,8 +938,9 @@ google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1m google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200626011028-ee7919e894b5/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200711021454-869866162049 h1:YFTFpQhgvrLrmxtiIncJxFXeCyq84ixuKWVCaCAi9Oc= google.golang.org/genproto v0.0.0-20200711021454-869866162049/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200728010541-3dc8dca74b7b h1:FWkel6k8GbR7SbBY200Cz8tA58/KtMrfpVZwOOSjOvQ= +google.golang.org/genproto v0.0.0-20200728010541-3dc8dca74b7b/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -951,8 +954,8 @@ google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0-dev.0.20200709232328-d8193ee9cc3e h1:Iq/Hxh7FiLz/wSuSQtZFjLjSKiEK01XIuX7E/3vGfFk= -google.golang.org/grpc v1.31.0-dev.0.20200709232328-d8193ee9cc3e/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.32.0-dev.0.20200728194956-1c32b02682df h1:woHwRKy729Cr1CGRuyGWIJOcXYK5DbQrfxK/hRUh2a8= +google.golang.org/grpc v1.32.0-dev.0.20200728194956-1c32b02682df/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1001,17 +1004,17 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4 h1:UoveltGrhghAA7ePc+e+QYDHXrBps2PqFZiHkGR/xK8= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.18.5 h1:fKbCxr+U3fu7k6jB+QeYPD/c6xKYeSJ2KVWmyUypuWM= -k8s.io/api v0.18.5/go.mod h1:tN+e/2nbdGKOAH55NMV8oGrMG+3uRlA9GaRfvnCCSNk= -k8s.io/apiextensions-apiserver v0.18.5 h1:pvbXjB/BRXZiO+/Erp5Pxr+lnhDCv5uxNxHh3FLGZ/g= -k8s.io/apiextensions-apiserver v0.18.5/go.mod h1:woZ7PkEIMHjhHIyApvOwkGOkBLUYKuet0VWVkPTQ/Fs= -k8s.io/apimachinery v0.18.5 h1:Lh6tgsM9FMkC12K5T5QjRm7rDs6aQN5JHkA0JomULDM= -k8s.io/apimachinery v0.18.5/go.mod h1:OaXp26zu/5J7p0f92ASynJa1pZo06YlV9fG7BoWbCko= -k8s.io/apiserver v0.18.5/go.mod h1:+1XgOMq7YJ3OyqPNSJ54EveHwCoBWcJT9CaPycYI5ps= -k8s.io/client-go v0.18.5 h1:cLhGZdOmyPhwtt20Lrb7uAqxxB1uvY+NTmNJvno1oKA= -k8s.io/client-go v0.18.5/go.mod h1:EsiD+7Fx+bRckKWZXnAXRKKetm1WuzPagH4iOSC8x58= -k8s.io/code-generator v0.18.5/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= -k8s.io/component-base v0.18.5/go.mod h1:RSbcboNk4B+S8Acs2JaBOVW3XNz1+A637s2jL+QQrlU= +k8s.io/api v0.18.6 h1:osqrAXbOQjkKIWDTjrqxWQ3w0GkKb1KA1XkUGHHYpeE= +k8s.io/api v0.18.6/go.mod h1:eeyxr+cwCjMdLAmr2W3RyDI0VvTawSg/3RFFBEnmZGI= +k8s.io/apiextensions-apiserver v0.18.6 h1:vDlk7cyFsDyfwn2rNAO2DbmUbvXy5yT5GE3rrqOzaMo= +k8s.io/apiextensions-apiserver v0.18.6/go.mod h1:lv89S7fUysXjLZO7ke783xOwVTm6lKizADfvUM/SS/M= +k8s.io/apimachinery v0.18.6 h1:RtFHnfGNfd1N0LeSrKCUznz5xtUP1elRGvHJbL3Ntag= +k8s.io/apimachinery v0.18.6/go.mod h1:OaXp26zu/5J7p0f92ASynJa1pZo06YlV9fG7BoWbCko= +k8s.io/apiserver v0.18.6/go.mod h1:Zt2XvTHuaZjBz6EFYzpp+X4hTmgWGy8AthNVnTdm3Wg= +k8s.io/client-go v0.18.6 h1:I+oWqJbibLSGsZj8Xs8F0aWVXJVIoUHWaaJV3kUN/Zw= +k8s.io/client-go v0.18.6/go.mod h1:/fwtGLjYMS1MaM5oi+eXhKwG+1UHidUEXRh6cNsdO0Q= +k8s.io/code-generator v0.18.6/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= +k8s.io/component-base v0.18.6/go.mod h1:knSVsibPR5K6EW2XOjEHik6sdU5nCvKMrzMt2D4In14= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= @@ -1022,8 +1025,8 @@ k8s.io/klog/v2 v2.0.0 h1:Foj74zO6RbjjP4hBEKjnYtjjAhGg4jNynUdYF6fJrok= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6 h1:Oh3Mzx5pJ+yIumsAD0MOECPVeXsVot0UkiaCGVyfGQY= k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= -k8s.io/metrics v0.18.5 h1:Q2YSvV3x3Z20LviLqPTyCC7HmdOZ1ijuSxEyEMh/4nc= -k8s.io/metrics v0.18.5/go.mod h1:pqn6YiCCxUt067ivZVo4KtvppvdykV6HHG5+7ygVkNg= +k8s.io/metrics v0.18.6 h1:IRMCn0KKNhbOSnxNZ+MhooRi8c67iIMjpGkKpm6oqOM= +k8s.io/metrics v0.18.6/go.mod h1:iAwGeabusQNO3duHDM7BBExTUB8L+iq8PM7N9EtQw6g= k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200603063816-c1c6865ac451 h1:v8ud2Up6QK1lNOKFgiIVrZdMg7MpmSnvtrOieolJKoE= k8s.io/utils v0.0.0-20200603063816-c1c6865ac451/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= diff --git a/hack/go.mod.default b/hack/go.mod.default index a107fcd986..e72f023698 100755 --- a/hack/go.mod.default +++ b/hack/go.mod.default @@ -17,10 +17,10 @@ replace ( github.com/gorilla/websocket => github.com/gorilla/websocket master github.com/tensorflow/tensorflow => github.com/tensorflow/tensorflow v2.1.0 golang.org/x/crypto => golang.org/x/crypto master - k8s.io/api => k8s.io/api v0.18.5 - k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.18.5 - k8s.io/apimachinery => k8s.io/apimachinery v0.18.5 - k8s.io/client-go => k8s.io/client-go v0.18.5 + k8s.io/api => k8s.io/api v0.18.6 + k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.18.6 + k8s.io/apimachinery => k8s.io/apimachinery v0.18.6 + k8s.io/client-go => k8s.io/client-go v0.18.6 sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.6.1 ) @@ -29,7 +29,7 @@ require ( contrib.go.opencensus.io/exporter/jaeger master contrib.go.opencensus.io/exporter/prometheus master contrib.go.opencensus.io/exporter/stackdriver master - github.com/aws/aws-sdk-go v1.33.5 + github.com/aws/aws-sdk-go v1.33.14 github.com/cespare/xxhash/v2 master github.com/cockroachdb/errors master github.com/envoyproxy/protoc-gen-validate master diff --git a/pkg/agent/core/ngt/config/config_test.go b/pkg/agent/core/ngt/config/config_test.go index e8090717ea..9a2a62be78 100644 --- a/pkg/agent/core/ngt/config/config_test.go +++ b/pkg/agent/core/ngt/config/config_test.go @@ -26,6 +26,7 @@ import ( ) func TestNewConfig(t *testing.T) { + t.Parallel() type args struct { path string } @@ -80,7 +81,8 @@ func TestNewConfig(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/agent/core/ngt/handler/grpc/handler_test.go b/pkg/agent/core/ngt/handler/grpc/handler_test.go index cdf1554c92..f2b5bcc431 100644 --- a/pkg/agent/core/ngt/handler/grpc/handler_test.go +++ b/pkg/agent/core/ngt/handler/grpc/handler_test.go @@ -31,6 +31,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -81,7 +82,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -102,6 +104,7 @@ func TestNew(t *testing.T) { } func Test_server_newLocation(t *testing.T) { + t.Parallel() type args struct { uuids []string } @@ -171,7 +174,8 @@ func Test_server_newLocation(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -198,6 +202,7 @@ func Test_server_newLocation(t *testing.T) { } func Test_server_Exists(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uid *payload.Object_ID @@ -274,7 +279,8 @@ func Test_server_Exists(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -301,6 +307,7 @@ func Test_server_Exists(t *testing.T) { } func Test_server_Search(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Search_Request @@ -377,7 +384,8 @@ func Test_server_Search(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -404,6 +412,7 @@ func Test_server_Search(t *testing.T) { } func Test_server_SearchByID(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Search_IDRequest @@ -480,7 +489,8 @@ func Test_server_SearchByID(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -507,6 +517,7 @@ func Test_server_SearchByID(t *testing.T) { } func Test_toSearchResponse(t *testing.T) { + t.Parallel() type args struct { dists []model.Distance err error @@ -564,7 +575,8 @@ func Test_toSearchResponse(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -585,6 +597,7 @@ func Test_toSearchResponse(t *testing.T) { } func Test_server_StreamSearch(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamSearchServer } @@ -654,7 +667,8 @@ func Test_server_StreamSearch(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -681,6 +695,7 @@ func Test_server_StreamSearch(t *testing.T) { } func Test_server_StreamSearchByID(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamSearchByIDServer } @@ -750,7 +765,8 @@ func Test_server_StreamSearchByID(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -777,6 +793,7 @@ func Test_server_StreamSearchByID(t *testing.T) { } func Test_server_Insert(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vec *payload.Object_Vector @@ -853,7 +870,8 @@ func Test_server_Insert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -880,6 +898,7 @@ func Test_server_Insert(t *testing.T) { } func Test_server_StreamInsert(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamInsertServer } @@ -949,7 +968,8 @@ func Test_server_StreamInsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -976,6 +996,7 @@ func Test_server_StreamInsert(t *testing.T) { } func Test_server_MultiInsert(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vecs *payload.Object_Vectors @@ -1052,7 +1073,8 @@ func Test_server_MultiInsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1079,6 +1101,7 @@ func Test_server_MultiInsert(t *testing.T) { } func Test_server_Update(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vec *payload.Object_Vector @@ -1155,7 +1178,8 @@ func Test_server_Update(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1182,6 +1206,7 @@ func Test_server_Update(t *testing.T) { } func Test_server_StreamUpdate(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamUpdateServer } @@ -1251,7 +1276,8 @@ func Test_server_StreamUpdate(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1278,6 +1304,7 @@ func Test_server_StreamUpdate(t *testing.T) { } func Test_server_MultiUpdate(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vecs *payload.Object_Vectors @@ -1354,7 +1381,8 @@ func Test_server_MultiUpdate(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1381,6 +1409,7 @@ func Test_server_MultiUpdate(t *testing.T) { } func Test_server_Upsert(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vec *payload.Object_Vector @@ -1457,7 +1486,8 @@ func Test_server_Upsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1484,6 +1514,7 @@ func Test_server_Upsert(t *testing.T) { } func Test_server_StreamUpsert(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamUpsertServer } @@ -1553,7 +1584,8 @@ func Test_server_StreamUpsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1580,6 +1612,7 @@ func Test_server_StreamUpsert(t *testing.T) { } func Test_server_MultiUpsert(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vecs *payload.Object_Vectors @@ -1656,7 +1689,8 @@ func Test_server_MultiUpsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1683,6 +1717,7 @@ func Test_server_MultiUpsert(t *testing.T) { } func Test_server_Remove(t *testing.T) { + t.Parallel() type args struct { ctx context.Context id *payload.Object_ID @@ -1759,7 +1794,8 @@ func Test_server_Remove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1786,6 +1822,7 @@ func Test_server_Remove(t *testing.T) { } func Test_server_StreamRemove(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamRemoveServer } @@ -1855,7 +1892,8 @@ func Test_server_StreamRemove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1882,6 +1920,7 @@ func Test_server_StreamRemove(t *testing.T) { } func Test_server_MultiRemove(t *testing.T) { + t.Parallel() type args struct { ctx context.Context ids *payload.Object_IDs @@ -1958,7 +1997,8 @@ func Test_server_MultiRemove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1985,6 +2025,7 @@ func Test_server_MultiRemove(t *testing.T) { } func Test_server_GetObject(t *testing.T) { + t.Parallel() type args struct { ctx context.Context id *payload.Object_ID @@ -2061,7 +2102,8 @@ func Test_server_GetObject(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -2088,6 +2130,7 @@ func Test_server_GetObject(t *testing.T) { } func Test_server_StreamGetObject(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamGetObjectServer } @@ -2157,7 +2200,8 @@ func Test_server_StreamGetObject(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -2184,6 +2228,7 @@ func Test_server_StreamGetObject(t *testing.T) { } func Test_server_CreateIndex(t *testing.T) { + t.Parallel() type args struct { ctx context.Context c *payload.Control_CreateIndexRequest @@ -2260,7 +2305,8 @@ func Test_server_CreateIndex(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -2287,6 +2333,7 @@ func Test_server_CreateIndex(t *testing.T) { } func Test_server_SaveIndex(t *testing.T) { + t.Parallel() type args struct { ctx context.Context in1 *payload.Empty @@ -2363,7 +2410,8 @@ func Test_server_SaveIndex(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -2390,6 +2438,7 @@ func Test_server_SaveIndex(t *testing.T) { } func Test_server_CreateAndSaveIndex(t *testing.T) { + t.Parallel() type args struct { ctx context.Context c *payload.Control_CreateIndexRequest @@ -2466,7 +2515,8 @@ func Test_server_CreateAndSaveIndex(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -2493,6 +2543,7 @@ func Test_server_CreateAndSaveIndex(t *testing.T) { } func Test_server_IndexInfo(t *testing.T) { + t.Parallel() type args struct { ctx context.Context in1 *payload.Empty @@ -2569,7 +2620,8 @@ func Test_server_IndexInfo(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/agent/core/ngt/handler/grpc/option_test.go b/pkg/agent/core/ngt/handler/grpc/option_test.go index 7153fe0b9c..e931926c95 100644 --- a/pkg/agent/core/ngt/handler/grpc/option_test.go +++ b/pkg/agent/core/ngt/handler/grpc/option_test.go @@ -25,6 +25,8 @@ import ( ) func TestWithNGT(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { n service.NGT @@ -62,7 +64,7 @@ func TestWithNGT(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -100,7 +102,8 @@ func TestWithNGT(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -121,7 +124,7 @@ func TestWithNGT(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -129,7 +132,7 @@ func TestWithNGT(t *testing.T) { got := WithNGT(test.args.n) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -138,6 +141,8 @@ func TestWithNGT(t *testing.T) { } func TestWithStreamConcurrency(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { c int @@ -175,7 +180,7 @@ func TestWithStreamConcurrency(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -213,7 +218,8 @@ func TestWithStreamConcurrency(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -234,7 +240,7 @@ func TestWithStreamConcurrency(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -242,7 +248,7 @@ func TestWithStreamConcurrency(t *testing.T) { got := WithStreamConcurrency(test.args.c) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/agent/core/ngt/handler/rest/handler_test.go b/pkg/agent/core/ngt/handler/rest/handler_test.go index cd6a946865..c8d673ff93 100644 --- a/pkg/agent/core/ngt/handler/rest/handler_test.go +++ b/pkg/agent/core/ngt/handler/rest/handler_test.go @@ -28,6 +28,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -78,7 +79,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -99,6 +101,7 @@ func TestNew(t *testing.T) { } func Test_handler_Index(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -166,7 +169,8 @@ func Test_handler_Index(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -190,6 +194,7 @@ func Test_handler_Index(t *testing.T) { } func Test_handler_Search(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -257,7 +262,8 @@ func Test_handler_Search(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -281,6 +287,7 @@ func Test_handler_Search(t *testing.T) { } func Test_handler_SearchByID(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -348,7 +355,8 @@ func Test_handler_SearchByID(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -372,6 +380,7 @@ func Test_handler_SearchByID(t *testing.T) { } func Test_handler_Insert(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -439,7 +448,8 @@ func Test_handler_Insert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -463,6 +473,7 @@ func Test_handler_Insert(t *testing.T) { } func Test_handler_MultiInsert(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -530,7 +541,8 @@ func Test_handler_MultiInsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -554,6 +566,7 @@ func Test_handler_MultiInsert(t *testing.T) { } func Test_handler_Update(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -621,7 +634,8 @@ func Test_handler_Update(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -645,6 +659,7 @@ func Test_handler_Update(t *testing.T) { } func Test_handler_MultiUpdate(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -712,7 +727,8 @@ func Test_handler_MultiUpdate(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -736,6 +752,7 @@ func Test_handler_MultiUpdate(t *testing.T) { } func Test_handler_Remove(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -803,7 +820,8 @@ func Test_handler_Remove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -827,6 +845,7 @@ func Test_handler_Remove(t *testing.T) { } func Test_handler_MultiRemove(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -894,7 +913,8 @@ func Test_handler_MultiRemove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -918,6 +938,7 @@ func Test_handler_MultiRemove(t *testing.T) { } func Test_handler_CreateIndex(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -985,7 +1006,8 @@ func Test_handler_CreateIndex(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1009,6 +1031,7 @@ func Test_handler_CreateIndex(t *testing.T) { } func Test_handler_SaveIndex(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -1076,7 +1099,8 @@ func Test_handler_SaveIndex(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1100,6 +1124,7 @@ func Test_handler_SaveIndex(t *testing.T) { } func Test_handler_CreateAndSaveIndex(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -1167,7 +1192,8 @@ func Test_handler_CreateAndSaveIndex(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1191,6 +1217,7 @@ func Test_handler_CreateAndSaveIndex(t *testing.T) { } func Test_handler_GetObject(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -1258,7 +1285,8 @@ func Test_handler_GetObject(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1282,6 +1310,7 @@ func Test_handler_GetObject(t *testing.T) { } func Test_handler_Exists(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -1349,7 +1378,8 @@ func Test_handler_Exists(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/agent/core/ngt/handler/rest/option_test.go b/pkg/agent/core/ngt/handler/rest/option_test.go index ecded43a95..9a023a05ae 100644 --- a/pkg/agent/core/ngt/handler/rest/option_test.go +++ b/pkg/agent/core/ngt/handler/rest/option_test.go @@ -25,6 +25,8 @@ import ( ) func TestWithAgent(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { a grpc.Server @@ -62,7 +64,7 @@ func TestWithAgent(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -100,7 +102,8 @@ func TestWithAgent(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -121,7 +124,7 @@ func TestWithAgent(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -129,7 +132,7 @@ func TestWithAgent(t *testing.T) { got := WithAgent(test.args.a) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/agent/core/ngt/router/option_test.go b/pkg/agent/core/ngt/router/option_test.go index 681fe0f850..c8d28d91d0 100644 --- a/pkg/agent/core/ngt/router/option_test.go +++ b/pkg/agent/core/ngt/router/option_test.go @@ -26,6 +26,8 @@ import ( ) func TestWithHandler(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { h rest.Handler @@ -63,7 +65,7 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -101,7 +103,8 @@ func TestWithHandler(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -122,7 +125,7 @@ func TestWithHandler(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -130,7 +133,7 @@ func TestWithHandler(t *testing.T) { got := WithHandler(test.args.h) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -139,6 +142,8 @@ func TestWithHandler(t *testing.T) { } func TestWithTimeout(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { timeout string @@ -176,7 +181,7 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -214,7 +219,8 @@ func TestWithTimeout(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -235,7 +241,7 @@ func TestWithTimeout(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -243,7 +249,7 @@ func TestWithTimeout(t *testing.T) { got := WithTimeout(test.args.timeout) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -252,6 +258,8 @@ func TestWithTimeout(t *testing.T) { } func TestWithErrGroup(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { eg errgroup.Group @@ -289,7 +297,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -327,7 +335,8 @@ func TestWithErrGroup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -348,7 +357,7 @@ func TestWithErrGroup(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -356,7 +365,7 @@ func TestWithErrGroup(t *testing.T) { got := WithErrGroup(test.args.eg) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/agent/core/ngt/router/router_test.go b/pkg/agent/core/ngt/router/router_test.go index 7be666ccd5..ec7ce94494 100644 --- a/pkg/agent/core/ngt/router/router_test.go +++ b/pkg/agent/core/ngt/router/router_test.go @@ -27,6 +27,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -77,7 +78,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/agent/core/ngt/service/kvs/kvs_test.go b/pkg/agent/core/ngt/service/kvs/kvs_test.go index 1f5dc59d4d..d595dbe0a0 100644 --- a/pkg/agent/core/ngt/service/kvs/kvs_test.go +++ b/pkg/agent/core/ngt/service/kvs/kvs_test.go @@ -26,6 +26,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type want struct { want BidiMap } @@ -66,7 +67,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -87,6 +89,7 @@ func TestNew(t *testing.T) { } func Test_bidi_Get(t *testing.T) { + t.Parallel() type args struct { key string } @@ -157,7 +160,8 @@ func Test_bidi_Get(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -183,6 +187,7 @@ func Test_bidi_Get(t *testing.T) { } func Test_bidi_GetInverse(t *testing.T) { + t.Parallel() type args struct { val uint32 } @@ -253,7 +258,8 @@ func Test_bidi_GetInverse(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -279,6 +285,7 @@ func Test_bidi_GetInverse(t *testing.T) { } func Test_bidi_Set(t *testing.T) { + t.Parallel() type args struct { key string val uint32 @@ -344,7 +351,8 @@ func Test_bidi_Set(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -369,6 +377,7 @@ func Test_bidi_Set(t *testing.T) { } func Test_bidi_Delete(t *testing.T) { + t.Parallel() type args struct { key string } @@ -439,7 +448,8 @@ func Test_bidi_Delete(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -465,6 +475,7 @@ func Test_bidi_Delete(t *testing.T) { } func Test_bidi_DeleteInverse(t *testing.T) { + t.Parallel() type args struct { val uint32 } @@ -535,7 +546,8 @@ func Test_bidi_DeleteInverse(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -561,6 +573,7 @@ func Test_bidi_DeleteInverse(t *testing.T) { } func Test_bidi_Range(t *testing.T) { + t.Parallel() type args struct { ctx context.Context f func(string, uint32) bool @@ -626,7 +639,8 @@ func Test_bidi_Range(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -651,6 +665,7 @@ func Test_bidi_Range(t *testing.T) { } func Test_bidi_Len(t *testing.T) { + t.Parallel() type fields struct { ou [slen]*ou uo [slen]*uo @@ -707,7 +722,8 @@ func Test_bidi_Len(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } diff --git a/pkg/agent/core/ngt/service/kvs/ou_test.go b/pkg/agent/core/ngt/service/kvs/ou_test.go index 7bae47dc2b..df9e3414d6 100644 --- a/pkg/agent/core/ngt/service/kvs/ou_test.go +++ b/pkg/agent/core/ngt/service/kvs/ou_test.go @@ -28,6 +28,7 @@ import ( ) func Test_newEntryOu(t *testing.T) { + t.Parallel() type args struct { i string } @@ -78,7 +79,8 @@ func Test_newEntryOu(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -99,6 +101,7 @@ func Test_newEntryOu(t *testing.T) { } func Test_ou_Load(t *testing.T) { + t.Parallel() type args struct { key uint32 } @@ -172,7 +175,8 @@ func Test_ou_Load(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -199,6 +203,7 @@ func Test_ou_Load(t *testing.T) { } func Test_entryOu_load(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -253,7 +258,8 @@ func Test_entryOu_load(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -277,6 +283,7 @@ func Test_entryOu_load(t *testing.T) { } func Test_ou_Store(t *testing.T) { + t.Parallel() type args struct { key uint32 value string @@ -345,7 +352,8 @@ func Test_ou_Store(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -371,6 +379,7 @@ func Test_ou_Store(t *testing.T) { } func Test_entryOu_tryStore(t *testing.T) { + t.Parallel() type args struct { i *string } @@ -431,7 +440,8 @@ func Test_entryOu_tryStore(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -455,6 +465,7 @@ func Test_entryOu_tryStore(t *testing.T) { } func Test_entryOu_unexpungeLocked(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -505,7 +516,8 @@ func Test_entryOu_unexpungeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -529,6 +541,7 @@ func Test_entryOu_unexpungeLocked(t *testing.T) { } func Test_entryOu_storeLocked(t *testing.T) { + t.Parallel() type args struct { i *string } @@ -585,7 +598,8 @@ func Test_entryOu_storeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -608,6 +622,7 @@ func Test_entryOu_storeLocked(t *testing.T) { } func Test_ou_Delete(t *testing.T) { + t.Parallel() type args struct { key uint32 } @@ -673,7 +688,8 @@ func Test_ou_Delete(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -699,6 +715,7 @@ func Test_ou_Delete(t *testing.T) { } func Test_entryOu_delete(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -749,7 +766,8 @@ func Test_entryOu_delete(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -773,6 +791,7 @@ func Test_entryOu_delete(t *testing.T) { } func Test_ou_missLocked(t *testing.T) { + t.Parallel() type fields struct { mu sync.Mutex read atomic.Value @@ -828,7 +847,8 @@ func Test_ou_missLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -854,6 +874,7 @@ func Test_ou_missLocked(t *testing.T) { } func Test_ou_dirtyLocked(t *testing.T) { + t.Parallel() type fields struct { mu sync.Mutex read atomic.Value @@ -909,7 +930,8 @@ func Test_ou_dirtyLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -935,6 +957,7 @@ func Test_ou_dirtyLocked(t *testing.T) { } func Test_entryOu_tryExpungeLocked(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -985,7 +1008,8 @@ func Test_entryOu_tryExpungeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } diff --git a/pkg/agent/core/ngt/service/kvs/uo_test.go b/pkg/agent/core/ngt/service/kvs/uo_test.go index a0531a410e..03b32b4899 100644 --- a/pkg/agent/core/ngt/service/kvs/uo_test.go +++ b/pkg/agent/core/ngt/service/kvs/uo_test.go @@ -28,6 +28,7 @@ import ( ) func Test_newEntryUo(t *testing.T) { + t.Parallel() type args struct { i uint32 } @@ -78,7 +79,8 @@ func Test_newEntryUo(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -99,6 +101,7 @@ func Test_newEntryUo(t *testing.T) { } func Test_uo_Load(t *testing.T) { + t.Parallel() type args struct { key string } @@ -172,7 +175,8 @@ func Test_uo_Load(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -199,6 +203,7 @@ func Test_uo_Load(t *testing.T) { } func Test_entryUo_load(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -253,7 +258,8 @@ func Test_entryUo_load(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -277,6 +283,7 @@ func Test_entryUo_load(t *testing.T) { } func Test_uo_Store(t *testing.T) { + t.Parallel() type args struct { key string value uint32 @@ -345,7 +352,8 @@ func Test_uo_Store(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -371,6 +379,7 @@ func Test_uo_Store(t *testing.T) { } func Test_entryUo_tryStore(t *testing.T) { + t.Parallel() type args struct { i *uint32 } @@ -431,7 +440,8 @@ func Test_entryUo_tryStore(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -455,6 +465,7 @@ func Test_entryUo_tryStore(t *testing.T) { } func Test_entryUo_unexpungeLocked(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -505,7 +516,8 @@ func Test_entryUo_unexpungeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -529,6 +541,7 @@ func Test_entryUo_unexpungeLocked(t *testing.T) { } func Test_entryUo_storeLocked(t *testing.T) { + t.Parallel() type args struct { i *uint32 } @@ -585,7 +598,8 @@ func Test_entryUo_storeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -608,6 +622,7 @@ func Test_entryUo_storeLocked(t *testing.T) { } func Test_uo_Delete(t *testing.T) { + t.Parallel() type args struct { key string } @@ -673,7 +688,8 @@ func Test_uo_Delete(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -699,6 +715,7 @@ func Test_uo_Delete(t *testing.T) { } func Test_entryUo_delete(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -749,7 +766,8 @@ func Test_entryUo_delete(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -773,6 +791,7 @@ func Test_entryUo_delete(t *testing.T) { } func Test_uo_Range(t *testing.T) { + t.Parallel() type args struct { f func(uuid string, oid uint32) bool } @@ -838,7 +857,8 @@ func Test_uo_Range(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -864,6 +884,7 @@ func Test_uo_Range(t *testing.T) { } func Test_uo_missLocked(t *testing.T) { + t.Parallel() type fields struct { mu sync.Mutex read atomic.Value @@ -919,7 +940,8 @@ func Test_uo_missLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -945,6 +967,7 @@ func Test_uo_missLocked(t *testing.T) { } func Test_uo_dirtyLocked(t *testing.T) { + t.Parallel() type fields struct { mu sync.Mutex read atomic.Value @@ -1000,7 +1023,8 @@ func Test_uo_dirtyLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -1026,6 +1050,7 @@ func Test_uo_dirtyLocked(t *testing.T) { } func Test_entryUo_tryExpungeLocked(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -1076,7 +1101,8 @@ func Test_entryUo_tryExpungeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } diff --git a/pkg/agent/core/ngt/service/ngt_test.go b/pkg/agent/core/ngt/service/ngt_test.go index 3b90b09008..e01163ce16 100644 --- a/pkg/agent/core/ngt/service/ngt_test.go +++ b/pkg/agent/core/ngt/service/ngt_test.go @@ -35,6 +35,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { cfg *config.NGT opts []Option @@ -92,6 +93,7 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -113,6 +115,7 @@ func TestNew(t *testing.T) { } func Test_ngt_initNGT(t *testing.T) { + t.Parallel() type args struct { opts []core.Option } @@ -239,6 +242,7 @@ func Test_ngt_initNGT(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -285,6 +289,7 @@ func Test_ngt_initNGT(t *testing.T) { } func Test_ngt_loadKVS(t *testing.T) { + t.Parallel() type fields struct { core core.NGT eg errgroup.Group @@ -401,6 +406,7 @@ func Test_ngt_loadKVS(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() @@ -447,6 +453,7 @@ func Test_ngt_loadKVS(t *testing.T) { } func Test_ngt_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -573,6 +580,7 @@ func Test_ngt_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -619,6 +627,7 @@ func Test_ngt_Start(t *testing.T) { } func Test_ngt_Search(t *testing.T) { + t.Parallel() type args struct { vec []float32 size uint32 @@ -758,6 +767,7 @@ func Test_ngt_Search(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -804,6 +814,7 @@ func Test_ngt_Search(t *testing.T) { } func Test_ngt_SearchByID(t *testing.T) { + t.Parallel() type args struct { uuid string size uint32 @@ -943,6 +954,7 @@ func Test_ngt_SearchByID(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -989,6 +1001,7 @@ func Test_ngt_SearchByID(t *testing.T) { } func Test_ngt_Insert(t *testing.T) { + t.Parallel() type args struct { uuid string vec []float32 @@ -1118,6 +1131,7 @@ func Test_ngt_Insert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1164,6 +1178,7 @@ func Test_ngt_Insert(t *testing.T) { } func Test_ngt_insert(t *testing.T) { + t.Parallel() type args struct { uuid string vec []float32 @@ -1299,6 +1314,7 @@ func Test_ngt_insert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1345,6 +1361,7 @@ func Test_ngt_insert(t *testing.T) { } func Test_ngt_InsertMultiple(t *testing.T) { + t.Parallel() type args struct { vecs map[string][]float32 } @@ -1471,6 +1488,7 @@ func Test_ngt_InsertMultiple(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1517,6 +1535,7 @@ func Test_ngt_InsertMultiple(t *testing.T) { } func Test_ngt_Update(t *testing.T) { + t.Parallel() type args struct { uuid string vec []float32 @@ -1646,6 +1665,7 @@ func Test_ngt_Update(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1692,6 +1712,7 @@ func Test_ngt_Update(t *testing.T) { } func Test_ngt_UpdateMultiple(t *testing.T) { + t.Parallel() type args struct { vecs map[string][]float32 } @@ -1818,6 +1839,7 @@ func Test_ngt_UpdateMultiple(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1864,6 +1886,7 @@ func Test_ngt_UpdateMultiple(t *testing.T) { } func Test_ngt_Delete(t *testing.T) { + t.Parallel() type args struct { uuid string } @@ -1990,6 +2013,7 @@ func Test_ngt_Delete(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -2036,6 +2060,7 @@ func Test_ngt_Delete(t *testing.T) { } func Test_ngt_delete(t *testing.T) { + t.Parallel() type args struct { uuid string t int64 @@ -2165,6 +2190,7 @@ func Test_ngt_delete(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -2211,6 +2237,7 @@ func Test_ngt_delete(t *testing.T) { } func Test_ngt_DeleteMultiple(t *testing.T) { + t.Parallel() type args struct { uuids []string } @@ -2337,6 +2364,7 @@ func Test_ngt_DeleteMultiple(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -2383,6 +2411,7 @@ func Test_ngt_DeleteMultiple(t *testing.T) { } func Test_ngt_GetObject(t *testing.T) { + t.Parallel() type args struct { uuid string } @@ -2513,6 +2542,7 @@ func Test_ngt_GetObject(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -2559,6 +2589,7 @@ func Test_ngt_GetObject(t *testing.T) { } func Test_ngt_CreateIndex(t *testing.T) { + t.Parallel() type args struct { ctx context.Context poolSize uint32 @@ -2688,6 +2719,7 @@ func Test_ngt_CreateIndex(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -2734,6 +2766,7 @@ func Test_ngt_CreateIndex(t *testing.T) { } func Test_ngt_SaveIndex(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -2860,6 +2893,7 @@ func Test_ngt_SaveIndex(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -2906,6 +2940,7 @@ func Test_ngt_SaveIndex(t *testing.T) { } func Test_ngt_saveIndex(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -3032,6 +3067,7 @@ func Test_ngt_saveIndex(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -3078,6 +3114,7 @@ func Test_ngt_saveIndex(t *testing.T) { } func Test_ngt_CreateAndSaveIndex(t *testing.T) { + t.Parallel() type args struct { ctx context.Context poolSize uint32 @@ -3207,6 +3244,7 @@ func Test_ngt_CreateAndSaveIndex(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -3253,6 +3291,7 @@ func Test_ngt_CreateAndSaveIndex(t *testing.T) { } func Test_ngt_Exists(t *testing.T) { + t.Parallel() type args struct { uuid string } @@ -3383,6 +3422,7 @@ func Test_ngt_Exists(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -3429,6 +3469,7 @@ func Test_ngt_Exists(t *testing.T) { } func Test_ngt_insertCache(t *testing.T) { + t.Parallel() type args struct { uuid string } @@ -3559,6 +3600,7 @@ func Test_ngt_insertCache(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -3605,6 +3647,7 @@ func Test_ngt_insertCache(t *testing.T) { } func Test_ngt_IsIndexing(t *testing.T) { + t.Parallel() type fields struct { core core.NGT eg errgroup.Group @@ -3721,6 +3764,7 @@ func Test_ngt_IsIndexing(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() @@ -3767,6 +3811,7 @@ func Test_ngt_IsIndexing(t *testing.T) { } func Test_ngt_UUIDs(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -3893,6 +3938,7 @@ func Test_ngt_UUIDs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -3939,6 +3985,7 @@ func Test_ngt_UUIDs(t *testing.T) { } func Test_ngt_UncommittedUUIDs(t *testing.T) { + t.Parallel() type fields struct { core core.NGT eg errgroup.Group @@ -4055,6 +4102,7 @@ func Test_ngt_UncommittedUUIDs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() @@ -4101,6 +4149,7 @@ func Test_ngt_UncommittedUUIDs(t *testing.T) { } func Test_ngt_NumberOfCreateIndexExecution(t *testing.T) { + t.Parallel() type fields struct { core core.NGT eg errgroup.Group @@ -4217,6 +4266,7 @@ func Test_ngt_NumberOfCreateIndexExecution(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() @@ -4263,6 +4313,7 @@ func Test_ngt_NumberOfCreateIndexExecution(t *testing.T) { } func Test_ngt_Len(t *testing.T) { + t.Parallel() type fields struct { core core.NGT eg errgroup.Group @@ -4379,6 +4430,7 @@ func Test_ngt_Len(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() @@ -4425,6 +4477,7 @@ func Test_ngt_Len(t *testing.T) { } func Test_ngt_InsertVCacheLen(t *testing.T) { + t.Parallel() type fields struct { core core.NGT eg errgroup.Group @@ -4541,6 +4594,7 @@ func Test_ngt_InsertVCacheLen(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() @@ -4587,6 +4641,7 @@ func Test_ngt_InsertVCacheLen(t *testing.T) { } func Test_ngt_DeleteVCacheLen(t *testing.T) { + t.Parallel() type fields struct { core core.NGT eg errgroup.Group @@ -4703,6 +4758,7 @@ func Test_ngt_DeleteVCacheLen(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() @@ -4749,6 +4805,7 @@ func Test_ngt_DeleteVCacheLen(t *testing.T) { } func Test_ngt_Close(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -4875,6 +4932,7 @@ func Test_ngt_Close(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/agent/core/ngt/service/option_test.go b/pkg/agent/core/ngt/service/option_test.go index e2d5b7475c..47c7f799f3 100644 --- a/pkg/agent/core/ngt/service/option_test.go +++ b/pkg/agent/core/ngt/service/option_test.go @@ -24,6 +24,7 @@ import ( ) func TestWithErrGroup(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -100,6 +101,7 @@ func TestWithErrGroup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -138,6 +140,7 @@ func TestWithErrGroup(t *testing.T) { } func TestWithEnableInMemoryMode(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -214,6 +217,7 @@ func TestWithEnableInMemoryMode(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -252,6 +256,7 @@ func TestWithEnableInMemoryMode(t *testing.T) { } func TestWithIndexPath(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -328,6 +333,7 @@ func TestWithIndexPath(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -366,6 +372,7 @@ func TestWithIndexPath(t *testing.T) { } func TestWithAutoIndexCheckDuration(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -442,6 +449,7 @@ func TestWithAutoIndexCheckDuration(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -480,6 +488,7 @@ func TestWithAutoIndexCheckDuration(t *testing.T) { } func TestWithAutoIndexDurationLimit(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -556,6 +565,7 @@ func TestWithAutoIndexDurationLimit(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -594,6 +604,7 @@ func TestWithAutoIndexDurationLimit(t *testing.T) { } func TestWithAutoSaveIndexDuration(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -670,6 +681,7 @@ func TestWithAutoSaveIndexDuration(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -708,6 +720,7 @@ func TestWithAutoSaveIndexDuration(t *testing.T) { } func TestWithAutoIndexLength(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -784,6 +797,7 @@ func TestWithAutoIndexLength(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -822,6 +836,7 @@ func TestWithAutoIndexLength(t *testing.T) { } func TestWithInitialDelayMaxDuration(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -898,6 +913,7 @@ func TestWithInitialDelayMaxDuration(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -936,6 +952,7 @@ func TestWithInitialDelayMaxDuration(t *testing.T) { } func TestWithMinLoadIndexTimeout(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -1012,6 +1029,7 @@ func TestWithMinLoadIndexTimeout(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1050,6 +1068,7 @@ func TestWithMinLoadIndexTimeout(t *testing.T) { } func TestWithMaxLoadIndexTimeout(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -1126,6 +1145,7 @@ func TestWithMaxLoadIndexTimeout(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1164,6 +1184,7 @@ func TestWithMaxLoadIndexTimeout(t *testing.T) { } func TestWithLoadIndexTimeoutFactor(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -1240,6 +1261,7 @@ func TestWithLoadIndexTimeoutFactor(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1278,6 +1300,7 @@ func TestWithLoadIndexTimeoutFactor(t *testing.T) { } func TestWithDefaultPoolSize(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -1354,6 +1377,7 @@ func TestWithDefaultPoolSize(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1392,6 +1416,7 @@ func TestWithDefaultPoolSize(t *testing.T) { } func TestWithDefaultRadius(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -1468,6 +1493,7 @@ func TestWithDefaultRadius(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1506,6 +1532,7 @@ func TestWithDefaultRadius(t *testing.T) { } func TestWithDefaultEpsilon(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -1582,6 +1609,7 @@ func TestWithDefaultEpsilon(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/agent/core/ngt/service/vcaches_test.go b/pkg/agent/core/ngt/service/vcaches_test.go index bad0ff4d46..23077e4bed 100644 --- a/pkg/agent/core/ngt/service/vcaches_test.go +++ b/pkg/agent/core/ngt/service/vcaches_test.go @@ -28,6 +28,7 @@ import ( ) func Test_newEntryVCache(t *testing.T) { + t.Parallel() type args struct { i vcache } @@ -78,7 +79,8 @@ func Test_newEntryVCache(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -99,6 +101,7 @@ func Test_newEntryVCache(t *testing.T) { } func Test_vcaches_Load(t *testing.T) { + t.Parallel() type args struct { key string } @@ -175,7 +178,8 @@ func Test_vcaches_Load(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -203,6 +207,7 @@ func Test_vcaches_Load(t *testing.T) { } func Test_entryVCache_load(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -257,7 +262,8 @@ func Test_entryVCache_load(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -281,6 +287,7 @@ func Test_entryVCache_load(t *testing.T) { } func Test_vcaches_Store(t *testing.T) { + t.Parallel() type args struct { key string value vcache @@ -352,7 +359,8 @@ func Test_vcaches_Store(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -379,6 +387,7 @@ func Test_vcaches_Store(t *testing.T) { } func Test_entryVCache_tryStore(t *testing.T) { + t.Parallel() type args struct { i *vcache } @@ -439,7 +448,8 @@ func Test_entryVCache_tryStore(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -463,6 +473,7 @@ func Test_entryVCache_tryStore(t *testing.T) { } func Test_entryVCache_unexpungeLocked(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -513,7 +524,8 @@ func Test_entryVCache_unexpungeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -537,6 +549,7 @@ func Test_entryVCache_unexpungeLocked(t *testing.T) { } func Test_entryVCache_storeLocked(t *testing.T) { + t.Parallel() type args struct { i *vcache } @@ -593,7 +606,8 @@ func Test_entryVCache_storeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -616,6 +630,7 @@ func Test_entryVCache_storeLocked(t *testing.T) { } func Test_vcaches_Delete(t *testing.T) { + t.Parallel() type args struct { key string } @@ -684,7 +699,8 @@ func Test_vcaches_Delete(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -711,6 +727,7 @@ func Test_vcaches_Delete(t *testing.T) { } func Test_entryVCache_delete(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -761,7 +778,8 @@ func Test_entryVCache_delete(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -785,6 +803,7 @@ func Test_entryVCache_delete(t *testing.T) { } func Test_vcaches_Range(t *testing.T) { + t.Parallel() type args struct { f func(key string, value vcache) bool } @@ -853,7 +872,8 @@ func Test_vcaches_Range(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -880,6 +900,7 @@ func Test_vcaches_Range(t *testing.T) { } func Test_vcaches_missLocked(t *testing.T) { + t.Parallel() type fields struct { length uint64 mu sync.Mutex @@ -938,7 +959,8 @@ func Test_vcaches_missLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -965,6 +987,7 @@ func Test_vcaches_missLocked(t *testing.T) { } func Test_vcaches_dirtyLocked(t *testing.T) { + t.Parallel() type fields struct { length uint64 mu sync.Mutex @@ -1023,7 +1046,8 @@ func Test_vcaches_dirtyLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -1050,6 +1074,7 @@ func Test_vcaches_dirtyLocked(t *testing.T) { } func Test_entryVCache_tryExpungeLocked(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -1100,7 +1125,8 @@ func Test_entryVCache_tryExpungeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -1124,6 +1150,7 @@ func Test_entryVCache_tryExpungeLocked(t *testing.T) { } func Test_vcaches_Len(t *testing.T) { + t.Parallel() type fields struct { length uint64 mu sync.Mutex @@ -1186,7 +1213,8 @@ func Test_vcaches_Len(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } diff --git a/pkg/agent/core/ngt/usecase/agentd_test.go b/pkg/agent/core/ngt/usecase/agentd_test.go index e02c9e2da5..904f26de58 100644 --- a/pkg/agent/core/ngt/usecase/agentd_test.go +++ b/pkg/agent/core/ngt/usecase/agentd_test.go @@ -32,6 +32,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { cfg *config.Data } @@ -86,7 +87,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -107,6 +109,7 @@ func TestNew(t *testing.T) { } func Test_run_PreStart(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -179,7 +182,8 @@ func Test_run_PreStart(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -207,6 +211,7 @@ func Test_run_PreStart(t *testing.T) { } func Test_run_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -283,7 +288,8 @@ func Test_run_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -311,6 +317,7 @@ func Test_run_Start(t *testing.T) { } func Test_run_PreStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -383,7 +390,8 @@ func Test_run_PreStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -411,6 +419,7 @@ func Test_run_PreStop(t *testing.T) { } func Test_run_Stop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -483,7 +492,8 @@ func Test_run_Stop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -511,6 +521,7 @@ func Test_run_Stop(t *testing.T) { } func Test_run_PostStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -583,7 +594,8 @@ func Test_run_PostStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/agent/internal/metadata/metadata_test.go b/pkg/agent/internal/metadata/metadata_test.go index bd231f7718..0f18a8c449 100644 --- a/pkg/agent/internal/metadata/metadata_test.go +++ b/pkg/agent/internal/metadata/metadata_test.go @@ -26,6 +26,7 @@ import ( ) func TestLoad(t *testing.T) { + t.Parallel() type args struct { path string } @@ -80,6 +81,7 @@ func TestLoad(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -101,6 +103,7 @@ func TestLoad(t *testing.T) { } func TestStore(t *testing.T) { + t.Parallel() type args struct { path string meta *Metadata @@ -154,6 +157,7 @@ func TestStore(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/agent/sidecar/config/config_test.go b/pkg/agent/sidecar/config/config_test.go index 849135514e..1b89c9cf6b 100644 --- a/pkg/agent/sidecar/config/config_test.go +++ b/pkg/agent/sidecar/config/config_test.go @@ -26,6 +26,7 @@ import ( ) func TestMode_String(t *testing.T) { + t.Parallel() type want struct { want string } @@ -67,7 +68,8 @@ func TestMode_String(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -88,6 +90,7 @@ func TestMode_String(t *testing.T) { } func TestSidecarMode(t *testing.T) { + t.Parallel() type args struct { m string } @@ -138,7 +141,8 @@ func TestSidecarMode(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -159,6 +163,7 @@ func TestSidecarMode(t *testing.T) { } func TestNewConfig(t *testing.T) { + t.Parallel() type args struct { path string } @@ -213,7 +218,8 @@ func TestNewConfig(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/agent/sidecar/handler/grpc/handler_test.go b/pkg/agent/sidecar/handler/grpc/handler_test.go index 81ebd95bbe..c09505ddb5 100644 --- a/pkg/agent/sidecar/handler/grpc/handler_test.go +++ b/pkg/agent/sidecar/handler/grpc/handler_test.go @@ -27,6 +27,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -77,7 +78,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/agent/sidecar/handler/grpc/option_test.go b/pkg/agent/sidecar/handler/grpc/option_test.go index a22401e8f9..15491f6628 100644 --- a/pkg/agent/sidecar/handler/grpc/option_test.go +++ b/pkg/agent/sidecar/handler/grpc/option_test.go @@ -25,6 +25,8 @@ import ( ) func TestWithStorageObserver(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { so observer.StorageObserver @@ -62,7 +64,7 @@ func TestWithStorageObserver(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -100,7 +102,8 @@ func TestWithStorageObserver(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -121,7 +124,7 @@ func TestWithStorageObserver(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -129,7 +132,7 @@ func TestWithStorageObserver(t *testing.T) { got := WithStorageObserver(test.args.so) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/agent/sidecar/handler/rest/handler_test.go b/pkg/agent/sidecar/handler/rest/handler_test.go index 8fc6c65f7f..5daa92701f 100644 --- a/pkg/agent/sidecar/handler/rest/handler_test.go +++ b/pkg/agent/sidecar/handler/rest/handler_test.go @@ -28,6 +28,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -78,7 +79,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -99,6 +101,7 @@ func TestNew(t *testing.T) { } func Test_handler_Index(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -166,7 +169,8 @@ func Test_handler_Index(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/agent/sidecar/handler/rest/option_test.go b/pkg/agent/sidecar/handler/rest/option_test.go index 17c17ecd99..154fc65ebf 100644 --- a/pkg/agent/sidecar/handler/rest/option_test.go +++ b/pkg/agent/sidecar/handler/rest/option_test.go @@ -25,6 +25,8 @@ import ( ) func TestWithSidecar(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { sc sidecar.SidecarServer @@ -62,7 +64,7 @@ func TestWithSidecar(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -100,7 +102,8 @@ func TestWithSidecar(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -121,7 +124,7 @@ func TestWithSidecar(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -129,7 +132,7 @@ func TestWithSidecar(t *testing.T) { got := WithSidecar(test.args.sc) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/agent/sidecar/router/option_test.go b/pkg/agent/sidecar/router/option_test.go index 217bd212fe..bb0fa87bfc 100644 --- a/pkg/agent/sidecar/router/option_test.go +++ b/pkg/agent/sidecar/router/option_test.go @@ -25,6 +25,8 @@ import ( ) func TestWithHandler(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { h rest.Handler @@ -62,7 +64,7 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -100,7 +102,8 @@ func TestWithHandler(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -121,7 +124,7 @@ func TestWithHandler(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -129,7 +132,7 @@ func TestWithHandler(t *testing.T) { got := WithHandler(test.args.h) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -138,6 +141,8 @@ func TestWithHandler(t *testing.T) { } func TestWithTimeout(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { timeout string @@ -175,7 +180,7 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -213,7 +218,8 @@ func TestWithTimeout(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -234,7 +240,7 @@ func TestWithTimeout(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -242,7 +248,7 @@ func TestWithTimeout(t *testing.T) { got := WithTimeout(test.args.timeout) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/agent/sidecar/router/router_test.go b/pkg/agent/sidecar/router/router_test.go index 7be666ccd5..ec7ce94494 100644 --- a/pkg/agent/sidecar/router/router_test.go +++ b/pkg/agent/sidecar/router/router_test.go @@ -27,6 +27,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -77,7 +78,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/agent/sidecar/service/observer/observer_test.go b/pkg/agent/sidecar/service/observer/observer_test.go index db03d23d8c..e6e7219b8f 100644 --- a/pkg/agent/sidecar/service/observer/observer_test.go +++ b/pkg/agent/sidecar/service/observer/observer_test.go @@ -31,6 +31,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -85,6 +86,7 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -106,6 +108,7 @@ func TestNew(t *testing.T) { } func Test_observer_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -197,6 +200,7 @@ func Test_observer_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -230,6 +234,7 @@ func Test_observer_Start(t *testing.T) { } func Test_observer_PostStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -317,6 +322,7 @@ func Test_observer_PostStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -350,6 +356,7 @@ func Test_observer_PostStop(t *testing.T) { } func Test_observer_startTicker(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -441,6 +448,7 @@ func Test_observer_startTicker(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -474,6 +482,7 @@ func Test_observer_startTicker(t *testing.T) { } func Test_observer_startBackupLoop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -565,6 +574,7 @@ func Test_observer_startBackupLoop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -598,6 +608,7 @@ func Test_observer_startBackupLoop(t *testing.T) { } func Test_observer_onWrite(t *testing.T) { + t.Parallel() type args struct { ctx context.Context name string @@ -688,6 +699,7 @@ func Test_observer_onWrite(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -721,6 +733,7 @@ func Test_observer_onWrite(t *testing.T) { } func Test_observer_onCreate(t *testing.T) { + t.Parallel() type args struct { ctx context.Context name string @@ -811,6 +824,7 @@ func Test_observer_onCreate(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -844,8 +858,7 @@ func Test_observer_onCreate(t *testing.T) { } func Test_observer_isValidMetadata(t *testing.T) { - type args struct { - } + t.Parallel() type fields struct { w watch.Watcher dir string @@ -864,12 +877,11 @@ func Test_observer_isValidMetadata(t *testing.T) { } type test struct { name string - args args fields fields want want checkFunc func(want, bool, error) error - beforeFunc func(args) - afterFunc func(args) + beforeFunc func() + afterFunc func() } defaultCheckFunc := func(w want, got bool, err error) error { if !errors.Is(err, w.err) { @@ -885,8 +897,6 @@ func Test_observer_isValidMetadata(t *testing.T) { /* { name: "test_case_1", - args: args { - }, fields: fields { w: nil, dir: "", @@ -909,8 +919,6 @@ func Test_observer_isValidMetadata(t *testing.T) { func() test { return test { name: "test_case_2", - args: args { - }, fields: fields { w: nil, dir: "", @@ -932,12 +940,13 @@ func Test_observer_isValidMetadata(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { - test.beforeFunc(test.args) + test.beforeFunc() } if test.afterFunc != nil { - defer test.afterFunc(test.args) + defer test.afterFunc() } if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -965,6 +974,7 @@ func Test_observer_isValidMetadata(t *testing.T) { } func Test_observer_terminate(t *testing.T) { + t.Parallel() type fields struct { w watch.Watcher dir string @@ -1042,6 +1052,7 @@ func Test_observer_terminate(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() @@ -1075,6 +1086,7 @@ func Test_observer_terminate(t *testing.T) { } func Test_observer_requestBackup(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -1162,6 +1174,7 @@ func Test_observer_requestBackup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1195,6 +1208,7 @@ func Test_observer_requestBackup(t *testing.T) { } func Test_observer_backup(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -1282,6 +1296,7 @@ func Test_observer_backup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/agent/sidecar/service/observer/option_test.go b/pkg/agent/sidecar/service/observer/option_test.go index 6bebf5c016..b485b2fb3f 100644 --- a/pkg/agent/sidecar/service/observer/option_test.go +++ b/pkg/agent/sidecar/service/observer/option_test.go @@ -26,6 +26,7 @@ import ( ) func TestWithBackupDuration(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -102,6 +103,7 @@ func TestWithBackupDuration(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -140,6 +142,7 @@ func TestWithBackupDuration(t *testing.T) { } func TestWithPostStopTimeout(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -216,6 +219,7 @@ func TestWithPostStopTimeout(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -254,6 +258,7 @@ func TestWithPostStopTimeout(t *testing.T) { } func TestWithWatch(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -330,6 +335,7 @@ func TestWithWatch(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -368,6 +374,7 @@ func TestWithWatch(t *testing.T) { } func TestWithTicker(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -444,6 +451,7 @@ func TestWithTicker(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -482,6 +490,7 @@ func TestWithTicker(t *testing.T) { } func TestWithErrGroup(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -558,6 +567,7 @@ func TestWithErrGroup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -596,6 +606,7 @@ func TestWithErrGroup(t *testing.T) { } func TestWithDir(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -672,6 +683,7 @@ func TestWithDir(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -710,6 +722,7 @@ func TestWithDir(t *testing.T) { } func TestWithBlobStorage(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -786,6 +799,7 @@ func TestWithBlobStorage(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/agent/sidecar/service/restorer/option_test.go b/pkg/agent/sidecar/service/restorer/option_test.go index 8db086e3cf..48c7839a36 100644 --- a/pkg/agent/sidecar/service/restorer/option_test.go +++ b/pkg/agent/sidecar/service/restorer/option_test.go @@ -27,6 +27,7 @@ import ( ) func TestWithErrGroup(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -103,6 +104,7 @@ func TestWithErrGroup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -141,6 +143,7 @@ func TestWithErrGroup(t *testing.T) { } func TestWithDir(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -217,6 +220,7 @@ func TestWithDir(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -255,6 +259,7 @@ func TestWithDir(t *testing.T) { } func TestWithBlobStorage(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -331,6 +336,7 @@ func TestWithBlobStorage(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -368,11 +374,12 @@ func TestWithBlobStorage(t *testing.T) { } } -func TestWithBackoffOpts(t *testing.T) { +func TestWithBackoff(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { - opts []backoff.Option + enabled bool } type want struct { obj *T @@ -419,7 +426,7 @@ func TestWithBackoffOpts(t *testing.T) { { name: "test_case_1", args: args { - opts: nil, + enabled: false, }, want: want { obj: new(T), @@ -433,7 +440,7 @@ func TestWithBackoffOpts(t *testing.T) { return test { name: "test_case_2", args: args { - opts: nil, + enabled: false, }, want: want { obj: new(T), @@ -445,6 +452,7 @@ func TestWithBackoffOpts(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -459,7 +467,7 @@ func TestWithBackoffOpts(t *testing.T) { test.checkFunc = defaultCheckFunc } - got := WithBackoffOpts(test.args.opts...) + got := WithBackoff(test.args.enabled) obj := new(T) if err := test.checkFunc(test.want, obj, got(obj)); err != nil { tt.Errorf("error = %v", err) @@ -471,7 +479,7 @@ func TestWithBackoffOpts(t *testing.T) { if test.checkFunc == nil { test.checkFunc = defaultCheckFunc } - got := WithBackoffOpts(test.args.opts...) + got := WithBackoff(test.args.enabled) obj := new(T) got(obj) if err := test.checkFunc(test.want, obj); err != nil { @@ -482,11 +490,12 @@ func TestWithBackoffOpts(t *testing.T) { } } -func TestWithBackoff(t *testing.T) { +func TestWithBackoffOpts(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { - enabled bool + opts []backoff.Option } type want struct { obj *T @@ -533,7 +542,7 @@ func TestWithBackoff(t *testing.T) { { name: "test_case_1", args: args { - enabled: false, + opts: nil, }, want: want { obj: new(T), @@ -547,7 +556,7 @@ func TestWithBackoff(t *testing.T) { return test { name: "test_case_2", args: args { - enabled: false, + opts: nil, }, want: want { obj: new(T), @@ -559,6 +568,7 @@ func TestWithBackoff(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -573,7 +583,7 @@ func TestWithBackoff(t *testing.T) { test.checkFunc = defaultCheckFunc } - got := WithBackoff(test.args.enabled) + got := WithBackoffOpts(test.args.opts...) obj := new(T) if err := test.checkFunc(test.want, obj, got(obj)); err != nil { tt.Errorf("error = %v", err) @@ -585,7 +595,7 @@ func TestWithBackoff(t *testing.T) { if test.checkFunc == nil { test.checkFunc = defaultCheckFunc } - got := WithBackoff(test.args.enabled) + got := WithBackoffOpts(test.args.opts...) obj := new(T) got(obj) if err := test.checkFunc(test.want, obj); err != nil { diff --git a/pkg/agent/sidecar/service/restorer/restorer_test.go b/pkg/agent/sidecar/service/restorer/restorer_test.go index 1e6ac33cd8..84295c9bff 100644 --- a/pkg/agent/sidecar/service/restorer/restorer_test.go +++ b/pkg/agent/sidecar/service/restorer/restorer_test.go @@ -30,6 +30,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -84,6 +85,7 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -105,14 +107,16 @@ func TestNew(t *testing.T) { } func Test_restorer_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } type fields struct { - dir string - eg errgroup.Group - storage storage.Storage - backoffOpts []backoff.Option + dir string + eg errgroup.Group + storage storage.Storage + backoffEnabled bool + backoffOpts []backoff.Option } type want struct { want <-chan error @@ -148,6 +152,7 @@ func Test_restorer_Start(t *testing.T) { dir: "", eg: nil, storage: nil, + backoffEnabled: false, backoffOpts: nil, }, want: want{}, @@ -167,6 +172,7 @@ func Test_restorer_Start(t *testing.T) { dir: "", eg: nil, storage: nil, + backoffEnabled: false, backoffOpts: nil, }, want: want{}, @@ -178,6 +184,7 @@ func Test_restorer_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -189,10 +196,11 @@ func Test_restorer_Start(t *testing.T) { test.checkFunc = defaultCheckFunc } r := &restorer{ - dir: test.fields.dir, - eg: test.fields.eg, - storage: test.fields.storage, - backoffOpts: test.fields.backoffOpts, + dir: test.fields.dir, + eg: test.fields.eg, + storage: test.fields.storage, + backoffEnabled: test.fields.backoffEnabled, + backoffOpts: test.fields.backoffOpts, } got, err := r.Start(test.args.ctx) @@ -205,14 +213,16 @@ func Test_restorer_Start(t *testing.T) { } func Test_restorer_startRestore(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } type fields struct { - dir string - eg errgroup.Group - storage storage.Storage - backoffOpts []backoff.Option + dir string + eg errgroup.Group + storage storage.Storage + backoffEnabled bool + backoffOpts []backoff.Option } type want struct { want <-chan error @@ -248,6 +258,7 @@ func Test_restorer_startRestore(t *testing.T) { dir: "", eg: nil, storage: nil, + backoffEnabled: false, backoffOpts: nil, }, want: want{}, @@ -267,6 +278,7 @@ func Test_restorer_startRestore(t *testing.T) { dir: "", eg: nil, storage: nil, + backoffEnabled: false, backoffOpts: nil, }, want: want{}, @@ -278,6 +290,7 @@ func Test_restorer_startRestore(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -289,10 +302,11 @@ func Test_restorer_startRestore(t *testing.T) { test.checkFunc = defaultCheckFunc } r := &restorer{ - dir: test.fields.dir, - eg: test.fields.eg, - storage: test.fields.storage, - backoffOpts: test.fields.backoffOpts, + dir: test.fields.dir, + eg: test.fields.eg, + storage: test.fields.storage, + backoffEnabled: test.fields.backoffEnabled, + backoffOpts: test.fields.backoffOpts, } got, err := r.startRestore(test.args.ctx) @@ -305,14 +319,16 @@ func Test_restorer_startRestore(t *testing.T) { } func Test_restorer_restore(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } type fields struct { - dir string - eg errgroup.Group - storage storage.Storage - backoffOpts []backoff.Option + dir string + eg errgroup.Group + storage storage.Storage + backoffEnabled bool + backoffOpts []backoff.Option } type want struct { err error @@ -344,6 +360,7 @@ func Test_restorer_restore(t *testing.T) { dir: "", eg: nil, storage: nil, + backoffEnabled: false, backoffOpts: nil, }, want: want{}, @@ -363,6 +380,7 @@ func Test_restorer_restore(t *testing.T) { dir: "", eg: nil, storage: nil, + backoffEnabled: false, backoffOpts: nil, }, want: want{}, @@ -374,6 +392,7 @@ func Test_restorer_restore(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -385,10 +404,11 @@ func Test_restorer_restore(t *testing.T) { test.checkFunc = defaultCheckFunc } r := &restorer{ - dir: test.fields.dir, - eg: test.fields.eg, - storage: test.fields.storage, - backoffOpts: test.fields.backoffOpts, + dir: test.fields.dir, + eg: test.fields.eg, + storage: test.fields.storage, + backoffEnabled: test.fields.backoffEnabled, + backoffOpts: test.fields.backoffOpts, } err := r.restore(test.args.ctx) diff --git a/pkg/agent/sidecar/service/storage/option_test.go b/pkg/agent/sidecar/service/storage/option_test.go index 04e35e33c1..f07e522d87 100644 --- a/pkg/agent/sidecar/service/storage/option_test.go +++ b/pkg/agent/sidecar/service/storage/option_test.go @@ -27,6 +27,7 @@ import ( ) func TestWithErrGroup(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -103,6 +104,7 @@ func TestWithErrGroup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -141,6 +143,7 @@ func TestWithErrGroup(t *testing.T) { } func TestWithType(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -217,6 +220,7 @@ func TestWithType(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -255,6 +259,7 @@ func TestWithType(t *testing.T) { } func TestWithBucketName(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -331,6 +336,7 @@ func TestWithBucketName(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -369,6 +375,7 @@ func TestWithBucketName(t *testing.T) { } func TestWithFilename(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -445,6 +452,7 @@ func TestWithFilename(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -483,6 +491,7 @@ func TestWithFilename(t *testing.T) { } func TestWithFilenameSuffix(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -559,6 +568,7 @@ func TestWithFilenameSuffix(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -597,6 +607,7 @@ func TestWithFilenameSuffix(t *testing.T) { } func TestWithS3Opts(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -673,6 +684,7 @@ func TestWithS3Opts(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -711,6 +723,7 @@ func TestWithS3Opts(t *testing.T) { } func TestWithS3SessionOpts(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -787,6 +800,7 @@ func TestWithS3SessionOpts(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -825,6 +839,7 @@ func TestWithS3SessionOpts(t *testing.T) { } func TestWithCompressAlgorithm(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -901,6 +916,7 @@ func TestWithCompressAlgorithm(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -939,6 +955,7 @@ func TestWithCompressAlgorithm(t *testing.T) { } func TestWithCompressionLevel(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -1015,6 +1032,7 @@ func TestWithCompressionLevel(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/agent/sidecar/service/storage/storage_test.go b/pkg/agent/sidecar/service/storage/storage_test.go index 66ceb86114..363462711c 100644 --- a/pkg/agent/sidecar/service/storage/storage_test.go +++ b/pkg/agent/sidecar/service/storage/storage_test.go @@ -33,6 +33,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -87,6 +88,7 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -108,6 +110,7 @@ func TestNew(t *testing.T) { } func Test_bs_initCompressor(t *testing.T) { + t.Parallel() type fields struct { eg errgroup.Group storageType string @@ -188,6 +191,7 @@ func Test_bs_initCompressor(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() @@ -222,6 +226,7 @@ func Test_bs_initCompressor(t *testing.T) { } func Test_bs_initBucket(t *testing.T) { + t.Parallel() type fields struct { eg errgroup.Group storageType string @@ -302,6 +307,7 @@ func Test_bs_initBucket(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() @@ -336,6 +342,7 @@ func Test_bs_initBucket(t *testing.T) { } func Test_bs_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -430,6 +437,7 @@ func Test_bs_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -464,6 +472,7 @@ func Test_bs_Start(t *testing.T) { } func Test_bs_Reader(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -558,6 +567,7 @@ func Test_bs_Reader(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -592,6 +602,7 @@ func Test_bs_Reader(t *testing.T) { } func Test_bs_Writer(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -686,6 +697,7 @@ func Test_bs_Writer(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/agent/sidecar/usecase/initcontainer/initcontainer_test.go b/pkg/agent/sidecar/usecase/initcontainer/initcontainer_test.go index b40b5574f1..9ab40064a3 100644 --- a/pkg/agent/sidecar/usecase/initcontainer/initcontainer_test.go +++ b/pkg/agent/sidecar/usecase/initcontainer/initcontainer_test.go @@ -32,6 +32,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { cfg *config.Data } @@ -86,6 +87,7 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -107,6 +109,7 @@ func TestNew(t *testing.T) { } func Test_run_PreStart(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -179,6 +182,7 @@ func Test_run_PreStart(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -207,6 +211,7 @@ func Test_run_PreStart(t *testing.T) { } func Test_run_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -283,6 +288,7 @@ func Test_run_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -311,6 +317,7 @@ func Test_run_Start(t *testing.T) { } func Test_run_PreStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -383,6 +390,7 @@ func Test_run_PreStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -411,6 +419,7 @@ func Test_run_PreStop(t *testing.T) { } func Test_run_Stop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -483,6 +492,7 @@ func Test_run_Stop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -511,6 +521,7 @@ func Test_run_Stop(t *testing.T) { } func Test_run_PostStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -583,6 +594,7 @@ func Test_run_PostStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/agent/sidecar/usecase/sidecar/sidecar_test.go b/pkg/agent/sidecar/usecase/sidecar/sidecar_test.go index a5ebda8915..9a6b7e2bdb 100644 --- a/pkg/agent/sidecar/usecase/sidecar/sidecar_test.go +++ b/pkg/agent/sidecar/usecase/sidecar/sidecar_test.go @@ -32,6 +32,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { cfg *config.Data } @@ -86,6 +87,7 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -107,6 +109,7 @@ func TestNew(t *testing.T) { } func Test_run_PreStart(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -179,6 +182,7 @@ func Test_run_PreStart(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -207,6 +211,7 @@ func Test_run_PreStart(t *testing.T) { } func Test_run_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -283,6 +288,7 @@ func Test_run_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -311,6 +317,7 @@ func Test_run_Start(t *testing.T) { } func Test_run_PreStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -383,6 +390,7 @@ func Test_run_PreStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -411,6 +419,7 @@ func Test_run_PreStop(t *testing.T) { } func Test_run_Stop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -483,6 +492,7 @@ func Test_run_Stop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -511,6 +521,7 @@ func Test_run_Stop(t *testing.T) { } func Test_run_PostStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -583,6 +594,7 @@ func Test_run_PostStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/agent/sidecar/usecase/sidecard_test.go b/pkg/agent/sidecar/usecase/sidecard_test.go index 4246b5f479..c53990fd35 100644 --- a/pkg/agent/sidecar/usecase/sidecard_test.go +++ b/pkg/agent/sidecar/usecase/sidecard_test.go @@ -27,6 +27,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { cfg *config.Data } @@ -81,7 +82,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/discoverer/k8s/config/config_test.go b/pkg/discoverer/k8s/config/config_test.go index e8090717ea..9a2a62be78 100644 --- a/pkg/discoverer/k8s/config/config_test.go +++ b/pkg/discoverer/k8s/config/config_test.go @@ -26,6 +26,7 @@ import ( ) func TestNewConfig(t *testing.T) { + t.Parallel() type args struct { path string } @@ -80,7 +81,8 @@ func TestNewConfig(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/discoverer/k8s/handler/grpc/handler_test.go b/pkg/discoverer/k8s/handler/grpc/handler_test.go index 1ddb581145..e23492a773 100644 --- a/pkg/discoverer/k8s/handler/grpc/handler_test.go +++ b/pkg/discoverer/k8s/handler/grpc/handler_test.go @@ -30,6 +30,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -84,7 +85,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -105,6 +107,7 @@ func TestNew(t *testing.T) { } func Test_server_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -164,7 +167,8 @@ func Test_server_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -188,6 +192,7 @@ func Test_server_Start(t *testing.T) { } func Test_server_Pods(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Discoverer_Request @@ -258,7 +263,8 @@ func Test_server_Pods(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -283,6 +289,7 @@ func Test_server_Pods(t *testing.T) { } func Test_server_Nodes(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Discoverer_Request @@ -353,7 +360,8 @@ func Test_server_Nodes(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -378,6 +386,7 @@ func Test_server_Nodes(t *testing.T) { } func Test_singleflightKey(t *testing.T) { + t.Parallel() type args struct { pref string req *payload.Discoverer_Request @@ -431,7 +440,8 @@ func Test_singleflightKey(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/discoverer/k8s/handler/grpc/option_test.go b/pkg/discoverer/k8s/handler/grpc/option_test.go index dcec5a3c5f..8a4be2c6b0 100644 --- a/pkg/discoverer/k8s/handler/grpc/option_test.go +++ b/pkg/discoverer/k8s/handler/grpc/option_test.go @@ -25,6 +25,8 @@ import ( ) func TestWithDiscoverer(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { dsc service.Discoverer @@ -62,7 +64,7 @@ func TestWithDiscoverer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -100,7 +102,8 @@ func TestWithDiscoverer(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -121,7 +124,7 @@ func TestWithDiscoverer(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -129,7 +132,7 @@ func TestWithDiscoverer(t *testing.T) { got := WithDiscoverer(test.args.dsc) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/discoverer/k8s/handler/rest/handler_test.go b/pkg/discoverer/k8s/handler/rest/handler_test.go index 521d210d8e..2f95bae34b 100644 --- a/pkg/discoverer/k8s/handler/rest/handler_test.go +++ b/pkg/discoverer/k8s/handler/rest/handler_test.go @@ -28,6 +28,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -78,7 +79,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -99,6 +101,7 @@ func TestNew(t *testing.T) { } func Test_handler_Index(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -166,7 +169,8 @@ func Test_handler_Index(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -190,6 +194,7 @@ func Test_handler_Index(t *testing.T) { } func Test_handler_Pods(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -257,7 +262,8 @@ func Test_handler_Pods(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -281,6 +287,7 @@ func Test_handler_Pods(t *testing.T) { } func Test_handler_Nodes(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -348,7 +355,8 @@ func Test_handler_Nodes(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/discoverer/k8s/handler/rest/option_test.go b/pkg/discoverer/k8s/handler/rest/option_test.go index 55d8dfcdd0..88acf636a9 100644 --- a/pkg/discoverer/k8s/handler/rest/option_test.go +++ b/pkg/discoverer/k8s/handler/rest/option_test.go @@ -25,6 +25,8 @@ import ( ) func TestWithDiscoverer(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { dsc discoverer.DiscovererServer @@ -62,7 +64,7 @@ func TestWithDiscoverer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -100,7 +102,8 @@ func TestWithDiscoverer(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -121,7 +124,7 @@ func TestWithDiscoverer(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -129,7 +132,7 @@ func TestWithDiscoverer(t *testing.T) { got := WithDiscoverer(test.args.dsc) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/discoverer/k8s/router/option_test.go b/pkg/discoverer/k8s/router/option_test.go index ddb84975a8..307a4bf033 100644 --- a/pkg/discoverer/k8s/router/option_test.go +++ b/pkg/discoverer/k8s/router/option_test.go @@ -26,6 +26,8 @@ import ( ) func TestWithHandler(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { h rest.Handler @@ -63,7 +65,7 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -101,7 +103,8 @@ func TestWithHandler(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -122,7 +125,7 @@ func TestWithHandler(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -130,7 +133,7 @@ func TestWithHandler(t *testing.T) { got := WithHandler(test.args.h) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -139,6 +142,8 @@ func TestWithHandler(t *testing.T) { } func TestWithTimeout(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { timeout string @@ -176,7 +181,7 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -214,7 +219,8 @@ func TestWithTimeout(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -235,7 +241,7 @@ func TestWithTimeout(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -243,7 +249,7 @@ func TestWithTimeout(t *testing.T) { got := WithTimeout(test.args.timeout) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -252,6 +258,8 @@ func TestWithTimeout(t *testing.T) { } func TestWithErrGroup(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { eg errgroup.Group @@ -289,7 +297,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -327,7 +335,8 @@ func TestWithErrGroup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -348,7 +357,7 @@ func TestWithErrGroup(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -356,7 +365,7 @@ func TestWithErrGroup(t *testing.T) { got := WithErrGroup(test.args.eg) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/discoverer/k8s/router/router_test.go b/pkg/discoverer/k8s/router/router_test.go index 7be666ccd5..ec7ce94494 100644 --- a/pkg/discoverer/k8s/router/router_test.go +++ b/pkg/discoverer/k8s/router/router_test.go @@ -27,6 +27,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -77,7 +78,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/discoverer/k8s/service/discover_test.go b/pkg/discoverer/k8s/service/discover_test.go index e6fc34af2f..5898b601db 100644 --- a/pkg/discoverer/k8s/service/discover_test.go +++ b/pkg/discoverer/k8s/service/discover_test.go @@ -32,6 +32,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -86,7 +87,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -107,6 +109,7 @@ func TestNew(t *testing.T) { } func Test_discoverer_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -210,7 +213,8 @@ func Test_discoverer_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -247,6 +251,7 @@ func Test_discoverer_Start(t *testing.T) { } func Test_discoverer_GetPods(t *testing.T) { + t.Parallel() type args struct { req *payload.Discoverer_Request } @@ -350,7 +355,8 @@ func Test_discoverer_GetPods(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -387,6 +393,7 @@ func Test_discoverer_GetPods(t *testing.T) { } func Test_discoverer_GetNodes(t *testing.T) { + t.Parallel() type args struct { req *payload.Discoverer_Request } @@ -490,7 +497,8 @@ func Test_discoverer_GetNodes(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/discoverer/k8s/service/nodemap_test.go b/pkg/discoverer/k8s/service/nodemap_test.go index 54290f1cab..4ffe7a1eed 100644 --- a/pkg/discoverer/k8s/service/nodemap_test.go +++ b/pkg/discoverer/k8s/service/nodemap_test.go @@ -29,6 +29,7 @@ import ( ) func Test_newEntryNodeMap(t *testing.T) { + t.Parallel() type args struct { i node.Node } @@ -79,7 +80,8 @@ func Test_newEntryNodeMap(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -100,6 +102,7 @@ func Test_newEntryNodeMap(t *testing.T) { } func Test_nodeMap_Load(t *testing.T) { + t.Parallel() type args struct { key string } @@ -173,7 +176,8 @@ func Test_nodeMap_Load(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -200,6 +204,7 @@ func Test_nodeMap_Load(t *testing.T) { } func Test_entryNodeMap_load(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -254,7 +259,8 @@ func Test_entryNodeMap_load(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -278,6 +284,7 @@ func Test_entryNodeMap_load(t *testing.T) { } func Test_nodeMap_Store(t *testing.T) { + t.Parallel() type args struct { key string value node.Node @@ -346,7 +353,8 @@ func Test_nodeMap_Store(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -372,6 +380,7 @@ func Test_nodeMap_Store(t *testing.T) { } func Test_entryNodeMap_tryStore(t *testing.T) { + t.Parallel() type args struct { i *node.Node } @@ -432,7 +441,8 @@ func Test_entryNodeMap_tryStore(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -456,6 +466,7 @@ func Test_entryNodeMap_tryStore(t *testing.T) { } func Test_entryNodeMap_unexpungeLocked(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -506,7 +517,8 @@ func Test_entryNodeMap_unexpungeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -530,6 +542,7 @@ func Test_entryNodeMap_unexpungeLocked(t *testing.T) { } func Test_entryNodeMap_storeLocked(t *testing.T) { + t.Parallel() type args struct { i *node.Node } @@ -586,7 +599,8 @@ func Test_entryNodeMap_storeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -609,6 +623,7 @@ func Test_entryNodeMap_storeLocked(t *testing.T) { } func Test_nodeMap_LoadOrStore(t *testing.T) { + t.Parallel() type args struct { key string value node.Node @@ -685,7 +700,8 @@ func Test_nodeMap_LoadOrStore(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -712,6 +728,7 @@ func Test_nodeMap_LoadOrStore(t *testing.T) { } func Test_entryNodeMap_tryLoadOrStore(t *testing.T) { + t.Parallel() type args struct { i node.Node } @@ -780,7 +797,8 @@ func Test_entryNodeMap_tryLoadOrStore(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -804,6 +822,7 @@ func Test_entryNodeMap_tryLoadOrStore(t *testing.T) { } func Test_nodeMap_Delete(t *testing.T) { + t.Parallel() type args struct { key string } @@ -869,7 +888,8 @@ func Test_nodeMap_Delete(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -895,6 +915,7 @@ func Test_nodeMap_Delete(t *testing.T) { } func Test_entryNodeMap_delete(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -945,7 +966,8 @@ func Test_entryNodeMap_delete(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -969,6 +991,7 @@ func Test_entryNodeMap_delete(t *testing.T) { } func Test_nodeMap_Range(t *testing.T) { + t.Parallel() type args struct { f func(key string, value node.Node) bool } @@ -1034,7 +1057,8 @@ func Test_nodeMap_Range(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1060,6 +1084,7 @@ func Test_nodeMap_Range(t *testing.T) { } func Test_nodeMap_missLocked(t *testing.T) { + t.Parallel() type fields struct { mu sync.Mutex read atomic.Value @@ -1115,7 +1140,8 @@ func Test_nodeMap_missLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -1141,6 +1167,7 @@ func Test_nodeMap_missLocked(t *testing.T) { } func Test_nodeMap_dirtyLocked(t *testing.T) { + t.Parallel() type fields struct { mu sync.Mutex read atomic.Value @@ -1196,7 +1223,8 @@ func Test_nodeMap_dirtyLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -1222,6 +1250,7 @@ func Test_nodeMap_dirtyLocked(t *testing.T) { } func Test_entryNodeMap_tryExpungeLocked(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -1272,7 +1301,8 @@ func Test_entryNodeMap_tryExpungeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } diff --git a/pkg/discoverer/k8s/service/nodemetricsmap_test.go b/pkg/discoverer/k8s/service/nodemetricsmap_test.go index 94cde93f71..75f0ff156c 100644 --- a/pkg/discoverer/k8s/service/nodemetricsmap_test.go +++ b/pkg/discoverer/k8s/service/nodemetricsmap_test.go @@ -29,6 +29,7 @@ import ( ) func Test_newEntryNodeMetricsMap(t *testing.T) { + t.Parallel() type args struct { i mnode.Node } @@ -79,7 +80,8 @@ func Test_newEntryNodeMetricsMap(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -100,6 +102,7 @@ func Test_newEntryNodeMetricsMap(t *testing.T) { } func Test_nodeMetricsMap_Load(t *testing.T) { + t.Parallel() type args struct { key string } @@ -173,7 +176,8 @@ func Test_nodeMetricsMap_Load(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -200,6 +204,7 @@ func Test_nodeMetricsMap_Load(t *testing.T) { } func Test_entryNodeMetricsMap_load(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -254,7 +259,8 @@ func Test_entryNodeMetricsMap_load(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -278,6 +284,7 @@ func Test_entryNodeMetricsMap_load(t *testing.T) { } func Test_nodeMetricsMap_Store(t *testing.T) { + t.Parallel() type args struct { key string value mnode.Node @@ -346,7 +353,8 @@ func Test_nodeMetricsMap_Store(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -372,6 +380,7 @@ func Test_nodeMetricsMap_Store(t *testing.T) { } func Test_entryNodeMetricsMap_tryStore(t *testing.T) { + t.Parallel() type args struct { i *mnode.Node } @@ -432,7 +441,8 @@ func Test_entryNodeMetricsMap_tryStore(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -456,6 +466,7 @@ func Test_entryNodeMetricsMap_tryStore(t *testing.T) { } func Test_entryNodeMetricsMap_unexpungeLocked(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -506,7 +517,8 @@ func Test_entryNodeMetricsMap_unexpungeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -530,6 +542,7 @@ func Test_entryNodeMetricsMap_unexpungeLocked(t *testing.T) { } func Test_entryNodeMetricsMap_storeLocked(t *testing.T) { + t.Parallel() type args struct { i *mnode.Node } @@ -586,7 +599,8 @@ func Test_entryNodeMetricsMap_storeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -609,6 +623,7 @@ func Test_entryNodeMetricsMap_storeLocked(t *testing.T) { } func Test_nodeMetricsMap_LoadOrStore(t *testing.T) { + t.Parallel() type args struct { key string value mnode.Node @@ -685,7 +700,8 @@ func Test_nodeMetricsMap_LoadOrStore(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -712,6 +728,7 @@ func Test_nodeMetricsMap_LoadOrStore(t *testing.T) { } func Test_entryNodeMetricsMap_tryLoadOrStore(t *testing.T) { + t.Parallel() type args struct { i mnode.Node } @@ -780,7 +797,8 @@ func Test_entryNodeMetricsMap_tryLoadOrStore(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -804,6 +822,7 @@ func Test_entryNodeMetricsMap_tryLoadOrStore(t *testing.T) { } func Test_nodeMetricsMap_Delete(t *testing.T) { + t.Parallel() type args struct { key string } @@ -869,7 +888,8 @@ func Test_nodeMetricsMap_Delete(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -895,6 +915,7 @@ func Test_nodeMetricsMap_Delete(t *testing.T) { } func Test_entryNodeMetricsMap_delete(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -945,7 +966,8 @@ func Test_entryNodeMetricsMap_delete(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -969,6 +991,7 @@ func Test_entryNodeMetricsMap_delete(t *testing.T) { } func Test_nodeMetricsMap_Range(t *testing.T) { + t.Parallel() type args struct { f func(key string, value mnode.Node) bool } @@ -1034,7 +1057,8 @@ func Test_nodeMetricsMap_Range(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1060,6 +1084,7 @@ func Test_nodeMetricsMap_Range(t *testing.T) { } func Test_nodeMetricsMap_missLocked(t *testing.T) { + t.Parallel() type fields struct { mu sync.Mutex read atomic.Value @@ -1115,7 +1140,8 @@ func Test_nodeMetricsMap_missLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -1141,6 +1167,7 @@ func Test_nodeMetricsMap_missLocked(t *testing.T) { } func Test_nodeMetricsMap_dirtyLocked(t *testing.T) { + t.Parallel() type fields struct { mu sync.Mutex read atomic.Value @@ -1196,7 +1223,8 @@ func Test_nodeMetricsMap_dirtyLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -1222,6 +1250,7 @@ func Test_nodeMetricsMap_dirtyLocked(t *testing.T) { } func Test_entryNodeMetricsMap_tryExpungeLocked(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -1272,7 +1301,8 @@ func Test_entryNodeMetricsMap_tryExpungeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } diff --git a/pkg/discoverer/k8s/service/option_test.go b/pkg/discoverer/k8s/service/option_test.go index e61de10daa..eae92a1105 100644 --- a/pkg/discoverer/k8s/service/option_test.go +++ b/pkg/discoverer/k8s/service/option_test.go @@ -25,6 +25,8 @@ import ( ) func TestWithName(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { name string @@ -62,7 +64,7 @@ func TestWithName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -100,7 +102,8 @@ func TestWithName(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -121,7 +124,7 @@ func TestWithName(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -129,7 +132,7 @@ func TestWithName(t *testing.T) { got := WithName(test.args.name) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -138,6 +141,8 @@ func TestWithName(t *testing.T) { } func TestWithNamespace(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { ns string @@ -175,7 +180,7 @@ func TestWithNamespace(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -213,7 +218,8 @@ func TestWithNamespace(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -234,7 +240,7 @@ func TestWithNamespace(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -242,7 +248,7 @@ func TestWithNamespace(t *testing.T) { got := WithNamespace(test.args.ns) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -251,6 +257,8 @@ func TestWithNamespace(t *testing.T) { } func TestWithDiscoverDuration(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { dur string @@ -288,7 +296,7 @@ func TestWithDiscoverDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -326,7 +334,8 @@ func TestWithDiscoverDuration(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -347,7 +356,7 @@ func TestWithDiscoverDuration(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -355,7 +364,7 @@ func TestWithDiscoverDuration(t *testing.T) { got := WithDiscoverDuration(test.args.dur) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -364,6 +373,8 @@ func TestWithDiscoverDuration(t *testing.T) { } func TestWithErrGroup(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { eg errgroup.Group @@ -401,7 +412,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -439,7 +450,8 @@ func TestWithErrGroup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -460,7 +472,7 @@ func TestWithErrGroup(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -468,7 +480,7 @@ func TestWithErrGroup(t *testing.T) { got := WithErrGroup(test.args.eg) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/discoverer/k8s/service/podmetricsmap_test.go b/pkg/discoverer/k8s/service/podmetricsmap_test.go index 25bfe6bc48..cb47898e26 100644 --- a/pkg/discoverer/k8s/service/podmetricsmap_test.go +++ b/pkg/discoverer/k8s/service/podmetricsmap_test.go @@ -29,6 +29,7 @@ import ( ) func Test_newEntryPodMetricsMap(t *testing.T) { + t.Parallel() type args struct { i mpod.Pod } @@ -79,7 +80,8 @@ func Test_newEntryPodMetricsMap(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -100,6 +102,7 @@ func Test_newEntryPodMetricsMap(t *testing.T) { } func Test_podMetricsMap_Load(t *testing.T) { + t.Parallel() type args struct { key string } @@ -173,7 +176,8 @@ func Test_podMetricsMap_Load(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -200,6 +204,7 @@ func Test_podMetricsMap_Load(t *testing.T) { } func Test_entryPodMetricsMap_load(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -254,7 +259,8 @@ func Test_entryPodMetricsMap_load(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -278,6 +284,7 @@ func Test_entryPodMetricsMap_load(t *testing.T) { } func Test_podMetricsMap_Store(t *testing.T) { + t.Parallel() type args struct { key string value mpod.Pod @@ -346,7 +353,8 @@ func Test_podMetricsMap_Store(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -372,6 +380,7 @@ func Test_podMetricsMap_Store(t *testing.T) { } func Test_entryPodMetricsMap_tryStore(t *testing.T) { + t.Parallel() type args struct { i *mpod.Pod } @@ -432,7 +441,8 @@ func Test_entryPodMetricsMap_tryStore(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -456,6 +466,7 @@ func Test_entryPodMetricsMap_tryStore(t *testing.T) { } func Test_entryPodMetricsMap_unexpungeLocked(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -506,7 +517,8 @@ func Test_entryPodMetricsMap_unexpungeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -530,6 +542,7 @@ func Test_entryPodMetricsMap_unexpungeLocked(t *testing.T) { } func Test_entryPodMetricsMap_storeLocked(t *testing.T) { + t.Parallel() type args struct { i *mpod.Pod } @@ -586,7 +599,8 @@ func Test_entryPodMetricsMap_storeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -609,6 +623,7 @@ func Test_entryPodMetricsMap_storeLocked(t *testing.T) { } func Test_podMetricsMap_LoadOrStore(t *testing.T) { + t.Parallel() type args struct { key string value mpod.Pod @@ -685,7 +700,8 @@ func Test_podMetricsMap_LoadOrStore(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -712,6 +728,7 @@ func Test_podMetricsMap_LoadOrStore(t *testing.T) { } func Test_entryPodMetricsMap_tryLoadOrStore(t *testing.T) { + t.Parallel() type args struct { i mpod.Pod } @@ -780,7 +797,8 @@ func Test_entryPodMetricsMap_tryLoadOrStore(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -804,6 +822,7 @@ func Test_entryPodMetricsMap_tryLoadOrStore(t *testing.T) { } func Test_podMetricsMap_Delete(t *testing.T) { + t.Parallel() type args struct { key string } @@ -869,7 +888,8 @@ func Test_podMetricsMap_Delete(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -895,6 +915,7 @@ func Test_podMetricsMap_Delete(t *testing.T) { } func Test_entryPodMetricsMap_delete(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -945,7 +966,8 @@ func Test_entryPodMetricsMap_delete(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -969,6 +991,7 @@ func Test_entryPodMetricsMap_delete(t *testing.T) { } func Test_podMetricsMap_Range(t *testing.T) { + t.Parallel() type args struct { f func(key string, value mpod.Pod) bool } @@ -1034,7 +1057,8 @@ func Test_podMetricsMap_Range(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1060,6 +1084,7 @@ func Test_podMetricsMap_Range(t *testing.T) { } func Test_podMetricsMap_missLocked(t *testing.T) { + t.Parallel() type fields struct { mu sync.Mutex read atomic.Value @@ -1115,7 +1140,8 @@ func Test_podMetricsMap_missLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -1141,6 +1167,7 @@ func Test_podMetricsMap_missLocked(t *testing.T) { } func Test_podMetricsMap_dirtyLocked(t *testing.T) { + t.Parallel() type fields struct { mu sync.Mutex read atomic.Value @@ -1196,7 +1223,8 @@ func Test_podMetricsMap_dirtyLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -1222,6 +1250,7 @@ func Test_podMetricsMap_dirtyLocked(t *testing.T) { } func Test_entryPodMetricsMap_tryExpungeLocked(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -1272,7 +1301,8 @@ func Test_entryPodMetricsMap_tryExpungeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } diff --git a/pkg/discoverer/k8s/service/podsmap_test.go b/pkg/discoverer/k8s/service/podsmap_test.go index c6ce89f74b..5203809d3d 100644 --- a/pkg/discoverer/k8s/service/podsmap_test.go +++ b/pkg/discoverer/k8s/service/podsmap_test.go @@ -29,6 +29,7 @@ import ( ) func Test_newEntryPodsMap(t *testing.T) { + t.Parallel() type args struct { i []pod.Pod } @@ -79,7 +80,8 @@ func Test_newEntryPodsMap(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -100,6 +102,7 @@ func Test_newEntryPodsMap(t *testing.T) { } func Test_podsMap_Load(t *testing.T) { + t.Parallel() type args struct { key string } @@ -173,7 +176,8 @@ func Test_podsMap_Load(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -200,6 +204,7 @@ func Test_podsMap_Load(t *testing.T) { } func Test_entryPodsMap_load(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -254,7 +259,8 @@ func Test_entryPodsMap_load(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -278,6 +284,7 @@ func Test_entryPodsMap_load(t *testing.T) { } func Test_podsMap_Store(t *testing.T) { + t.Parallel() type args struct { key string value []pod.Pod @@ -346,7 +353,8 @@ func Test_podsMap_Store(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -372,6 +380,7 @@ func Test_podsMap_Store(t *testing.T) { } func Test_entryPodsMap_tryStore(t *testing.T) { + t.Parallel() type args struct { i *[]pod.Pod } @@ -432,7 +441,8 @@ func Test_entryPodsMap_tryStore(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -456,6 +466,7 @@ func Test_entryPodsMap_tryStore(t *testing.T) { } func Test_entryPodsMap_unexpungeLocked(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -506,7 +517,8 @@ func Test_entryPodsMap_unexpungeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -530,6 +542,7 @@ func Test_entryPodsMap_unexpungeLocked(t *testing.T) { } func Test_entryPodsMap_storeLocked(t *testing.T) { + t.Parallel() type args struct { i *[]pod.Pod } @@ -586,7 +599,8 @@ func Test_entryPodsMap_storeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -609,6 +623,7 @@ func Test_entryPodsMap_storeLocked(t *testing.T) { } func Test_podsMap_LoadOrStore(t *testing.T) { + t.Parallel() type args struct { key string value []pod.Pod @@ -685,7 +700,8 @@ func Test_podsMap_LoadOrStore(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -712,6 +728,7 @@ func Test_podsMap_LoadOrStore(t *testing.T) { } func Test_entryPodsMap_tryLoadOrStore(t *testing.T) { + t.Parallel() type args struct { i []pod.Pod } @@ -780,7 +797,8 @@ func Test_entryPodsMap_tryLoadOrStore(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -804,6 +822,7 @@ func Test_entryPodsMap_tryLoadOrStore(t *testing.T) { } func Test_podsMap_Delete(t *testing.T) { + t.Parallel() type args struct { key string } @@ -869,7 +888,8 @@ func Test_podsMap_Delete(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -895,6 +915,7 @@ func Test_podsMap_Delete(t *testing.T) { } func Test_entryPodsMap_delete(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -945,7 +966,8 @@ func Test_entryPodsMap_delete(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -969,6 +991,7 @@ func Test_entryPodsMap_delete(t *testing.T) { } func Test_podsMap_Range(t *testing.T) { + t.Parallel() type args struct { f func(key string, value []pod.Pod) bool } @@ -1034,7 +1057,8 @@ func Test_podsMap_Range(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1060,6 +1084,7 @@ func Test_podsMap_Range(t *testing.T) { } func Test_podsMap_missLocked(t *testing.T) { + t.Parallel() type fields struct { mu sync.Mutex read atomic.Value @@ -1115,7 +1140,8 @@ func Test_podsMap_missLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -1141,6 +1167,7 @@ func Test_podsMap_missLocked(t *testing.T) { } func Test_podsMap_dirtyLocked(t *testing.T) { + t.Parallel() type fields struct { mu sync.Mutex read atomic.Value @@ -1196,7 +1223,8 @@ func Test_podsMap_dirtyLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -1222,6 +1250,7 @@ func Test_podsMap_dirtyLocked(t *testing.T) { } func Test_entryPodsMap_tryExpungeLocked(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -1272,7 +1301,8 @@ func Test_entryPodsMap_tryExpungeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } diff --git a/pkg/discoverer/k8s/usecase/discovered_test.go b/pkg/discoverer/k8s/usecase/discovered_test.go index 047893e394..1bab5bc7d7 100644 --- a/pkg/discoverer/k8s/usecase/discovered_test.go +++ b/pkg/discoverer/k8s/usecase/discovered_test.go @@ -33,6 +33,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { cfg *config.Data } @@ -87,7 +88,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -108,6 +110,7 @@ func TestNew(t *testing.T) { } func Test_run_PreStart(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -183,7 +186,8 @@ func Test_run_PreStart(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -212,6 +216,7 @@ func Test_run_PreStart(t *testing.T) { } func Test_run_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -291,7 +296,8 @@ func Test_run_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -320,6 +326,7 @@ func Test_run_Start(t *testing.T) { } func Test_run_PreStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -395,7 +402,8 @@ func Test_run_PreStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -424,6 +432,7 @@ func Test_run_PreStop(t *testing.T) { } func Test_run_Stop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -499,7 +508,8 @@ func Test_run_Stop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -528,6 +538,7 @@ func Test_run_Stop(t *testing.T) { } func Test_run_PostStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -603,7 +614,8 @@ func Test_run_PostStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/gateway/backup/config/config_test.go b/pkg/gateway/backup/config/config_test.go index 6f1e2076f9..9a2a62be78 100644 --- a/pkg/gateway/backup/config/config_test.go +++ b/pkg/gateway/backup/config/config_test.go @@ -26,6 +26,7 @@ import ( ) func TestNewConfig(t *testing.T) { + t.Parallel() type args struct { path string } @@ -80,6 +81,7 @@ func TestNewConfig(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/backup/handler/grpc/checklist_test.go b/pkg/gateway/backup/handler/grpc/checklist_test.go index 147c124ce2..6cf7441259 100644 --- a/pkg/gateway/backup/handler/grpc/checklist_test.go +++ b/pkg/gateway/backup/handler/grpc/checklist_test.go @@ -28,6 +28,7 @@ import ( ) func Test_checkList_Exists(t *testing.T) { + t.Parallel() type args struct { key string } @@ -97,6 +98,7 @@ func Test_checkList_Exists(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -124,6 +126,7 @@ func Test_checkList_Exists(t *testing.T) { } func Test_checkList_Check(t *testing.T) { + t.Parallel() type args struct { key string } @@ -189,6 +192,7 @@ func Test_checkList_Check(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -215,6 +219,7 @@ func Test_checkList_Check(t *testing.T) { } func Test_entryCheckList_tryStore(t *testing.T) { + t.Parallel() type args struct { i *struct{} } @@ -275,6 +280,7 @@ func Test_entryCheckList_tryStore(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -299,6 +305,7 @@ func Test_entryCheckList_tryStore(t *testing.T) { } func Test_entryCheckList_unexpungeLocked(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -349,6 +356,7 @@ func Test_entryCheckList_unexpungeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() @@ -373,6 +381,7 @@ func Test_entryCheckList_unexpungeLocked(t *testing.T) { } func Test_checkList_missLocked(t *testing.T) { + t.Parallel() type fields struct { mu sync.Mutex read atomic.Value @@ -428,6 +437,7 @@ func Test_checkList_missLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() @@ -454,6 +464,7 @@ func Test_checkList_missLocked(t *testing.T) { } func Test_checkList_dirtyLocked(t *testing.T) { + t.Parallel() type fields struct { mu sync.Mutex read atomic.Value @@ -509,6 +520,7 @@ func Test_checkList_dirtyLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() @@ -535,6 +547,7 @@ func Test_checkList_dirtyLocked(t *testing.T) { } func Test_entryCheckList_tryExpungeLocked(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -585,6 +598,7 @@ func Test_entryCheckList_tryExpungeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() diff --git a/pkg/gateway/backup/handler/grpc/handler_test.go b/pkg/gateway/backup/handler/grpc/handler_test.go index ceccc27f4a..ce33a4feb2 100644 --- a/pkg/gateway/backup/handler/grpc/handler_test.go +++ b/pkg/gateway/backup/handler/grpc/handler_test.go @@ -33,6 +33,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -83,6 +84,7 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -104,6 +106,7 @@ func TestNew(t *testing.T) { } func Test_server_Exists(t *testing.T) { + t.Parallel() type args struct { ctx context.Context meta *payload.Object_ID @@ -186,6 +189,7 @@ func Test_server_Exists(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -215,6 +219,7 @@ func Test_server_Exists(t *testing.T) { } func Test_server_Search(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Search_Request @@ -297,6 +302,7 @@ func Test_server_Search(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -326,6 +332,7 @@ func Test_server_Search(t *testing.T) { } func Test_server_SearchByID(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Search_IDRequest @@ -408,6 +415,7 @@ func Test_server_SearchByID(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -437,6 +445,7 @@ func Test_server_SearchByID(t *testing.T) { } func Test_server_StreamSearch(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamSearchServer } @@ -512,6 +521,7 @@ func Test_server_StreamSearch(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -541,6 +551,7 @@ func Test_server_StreamSearch(t *testing.T) { } func Test_server_StreamSearchByID(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamSearchByIDServer } @@ -616,6 +627,7 @@ func Test_server_StreamSearchByID(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -645,6 +657,7 @@ func Test_server_StreamSearchByID(t *testing.T) { } func Test_server_Insert(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vec *payload.Object_Vector @@ -727,6 +740,7 @@ func Test_server_Insert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -756,6 +770,7 @@ func Test_server_Insert(t *testing.T) { } func Test_server_StreamInsert(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamInsertServer } @@ -831,6 +846,7 @@ func Test_server_StreamInsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -860,6 +876,7 @@ func Test_server_StreamInsert(t *testing.T) { } func Test_server_MultiInsert(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vecs *payload.Object_Vectors @@ -942,6 +959,7 @@ func Test_server_MultiInsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -971,6 +989,7 @@ func Test_server_MultiInsert(t *testing.T) { } func Test_server_Update(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vec *payload.Object_Vector @@ -1053,6 +1072,7 @@ func Test_server_Update(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1082,6 +1102,7 @@ func Test_server_Update(t *testing.T) { } func Test_server_StreamUpdate(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamUpdateServer } @@ -1157,6 +1178,7 @@ func Test_server_StreamUpdate(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1186,6 +1208,7 @@ func Test_server_StreamUpdate(t *testing.T) { } func Test_server_MultiUpdate(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vecs *payload.Object_Vectors @@ -1268,6 +1291,7 @@ func Test_server_MultiUpdate(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1297,6 +1321,7 @@ func Test_server_MultiUpdate(t *testing.T) { } func Test_server_Upsert(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vec *payload.Object_Vector @@ -1379,6 +1404,7 @@ func Test_server_Upsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1408,6 +1434,7 @@ func Test_server_Upsert(t *testing.T) { } func Test_server_StreamUpsert(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamUpsertServer } @@ -1483,6 +1510,7 @@ func Test_server_StreamUpsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1512,6 +1540,7 @@ func Test_server_StreamUpsert(t *testing.T) { } func Test_server_MultiUpsert(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vecs *payload.Object_Vectors @@ -1594,6 +1623,7 @@ func Test_server_MultiUpsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1623,6 +1653,7 @@ func Test_server_MultiUpsert(t *testing.T) { } func Test_server_Remove(t *testing.T) { + t.Parallel() type args struct { ctx context.Context id *payload.Object_ID @@ -1705,6 +1736,7 @@ func Test_server_Remove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1734,6 +1766,7 @@ func Test_server_Remove(t *testing.T) { } func Test_server_StreamRemove(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamRemoveServer } @@ -1809,6 +1842,7 @@ func Test_server_StreamRemove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1838,6 +1872,7 @@ func Test_server_StreamRemove(t *testing.T) { } func Test_server_MultiRemove(t *testing.T) { + t.Parallel() type args struct { ctx context.Context ids *payload.Object_IDs @@ -1920,6 +1955,7 @@ func Test_server_MultiRemove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1949,6 +1985,7 @@ func Test_server_MultiRemove(t *testing.T) { } func Test_server_GetObject(t *testing.T) { + t.Parallel() type args struct { ctx context.Context id *payload.Object_ID @@ -2031,6 +2068,7 @@ func Test_server_GetObject(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -2060,6 +2098,7 @@ func Test_server_GetObject(t *testing.T) { } func Test_server_StreamGetObject(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamGetObjectServer } @@ -2135,6 +2174,7 @@ func Test_server_StreamGetObject(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/backup/handler/grpc/option_test.go b/pkg/gateway/backup/handler/grpc/option_test.go index 401bf46658..d44d772c01 100644 --- a/pkg/gateway/backup/handler/grpc/option_test.go +++ b/pkg/gateway/backup/handler/grpc/option_test.go @@ -27,6 +27,7 @@ import ( ) func TestWithBackup(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -103,6 +104,7 @@ func TestWithBackup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -141,6 +143,7 @@ func TestWithBackup(t *testing.T) { } func TestWithClient(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -217,6 +220,7 @@ func TestWithClient(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -255,6 +259,7 @@ func TestWithClient(t *testing.T) { } func TestWithErrGroup(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -331,6 +336,7 @@ func TestWithErrGroup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -369,6 +375,7 @@ func TestWithErrGroup(t *testing.T) { } func TestWithStreamConcurrency(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -445,6 +452,7 @@ func TestWithStreamConcurrency(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/backup/handler/rest/handler_test.go b/pkg/gateway/backup/handler/rest/handler_test.go index ae0f640120..b8f8353265 100644 --- a/pkg/gateway/backup/handler/rest/handler_test.go +++ b/pkg/gateway/backup/handler/rest/handler_test.go @@ -28,6 +28,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -78,6 +79,7 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -99,6 +101,7 @@ func TestNew(t *testing.T) { } func Test_handler_Index(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -166,6 +169,7 @@ func Test_handler_Index(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -190,6 +194,7 @@ func Test_handler_Index(t *testing.T) { } func Test_handler_Search(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -257,6 +262,7 @@ func Test_handler_Search(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -281,6 +287,7 @@ func Test_handler_Search(t *testing.T) { } func Test_handler_SearchByID(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -348,6 +355,7 @@ func Test_handler_SearchByID(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -372,6 +380,7 @@ func Test_handler_SearchByID(t *testing.T) { } func Test_handler_Insert(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -439,6 +448,7 @@ func Test_handler_Insert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -463,6 +473,7 @@ func Test_handler_Insert(t *testing.T) { } func Test_handler_MultiInsert(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -530,6 +541,7 @@ func Test_handler_MultiInsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -554,6 +566,7 @@ func Test_handler_MultiInsert(t *testing.T) { } func Test_handler_Update(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -621,6 +634,7 @@ func Test_handler_Update(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -645,6 +659,7 @@ func Test_handler_Update(t *testing.T) { } func Test_handler_MultiUpdate(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -712,6 +727,7 @@ func Test_handler_MultiUpdate(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -736,6 +752,7 @@ func Test_handler_MultiUpdate(t *testing.T) { } func Test_handler_Remove(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -803,6 +820,7 @@ func Test_handler_Remove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -827,6 +845,7 @@ func Test_handler_Remove(t *testing.T) { } func Test_handler_MultiRemove(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -894,6 +913,7 @@ func Test_handler_MultiRemove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -918,6 +938,7 @@ func Test_handler_MultiRemove(t *testing.T) { } func Test_handler_GetObject(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -985,6 +1006,7 @@ func Test_handler_GetObject(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1009,6 +1031,7 @@ func Test_handler_GetObject(t *testing.T) { } func Test_handler_Exists(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -1076,6 +1099,7 @@ func Test_handler_Exists(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/backup/handler/rest/option_test.go b/pkg/gateway/backup/handler/rest/option_test.go index d45859d8db..851f4f03ce 100644 --- a/pkg/gateway/backup/handler/rest/option_test.go +++ b/pkg/gateway/backup/handler/rest/option_test.go @@ -25,6 +25,7 @@ import ( ) func TestWithVald(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -101,6 +102,7 @@ func TestWithVald(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/backup/router/option_test.go b/pkg/gateway/backup/router/option_test.go index e22643e1ae..396d1df09e 100644 --- a/pkg/gateway/backup/router/option_test.go +++ b/pkg/gateway/backup/router/option_test.go @@ -25,6 +25,7 @@ import ( ) func TestWithHandler(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -101,6 +102,7 @@ func TestWithHandler(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -139,6 +141,7 @@ func TestWithHandler(t *testing.T) { } func TestWithTimeout(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -215,6 +218,7 @@ func TestWithTimeout(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/backup/router/router_test.go b/pkg/gateway/backup/router/router_test.go index 043c1775f1..ec7ce94494 100644 --- a/pkg/gateway/backup/router/router_test.go +++ b/pkg/gateway/backup/router/router_test.go @@ -27,6 +27,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -77,6 +78,7 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/backup/service/backup_test.go b/pkg/gateway/backup/service/backup_test.go index 8021ffc8b1..8fa2899838 100644 --- a/pkg/gateway/backup/service/backup_test.go +++ b/pkg/gateway/backup/service/backup_test.go @@ -28,6 +28,7 @@ import ( ) func TestNewBackup(t *testing.T) { + t.Parallel() type args struct { opts []BackupOption } @@ -82,6 +83,7 @@ func TestNewBackup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -103,6 +105,7 @@ func TestNewBackup(t *testing.T) { } func Test_backup_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -170,6 +173,7 @@ func Test_backup_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -195,6 +199,7 @@ func Test_backup_Start(t *testing.T) { } func Test_backup_GetObject(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uuid string @@ -265,6 +270,7 @@ func Test_backup_GetObject(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -290,6 +296,7 @@ func Test_backup_GetObject(t *testing.T) { } func Test_backup_GetLocation(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uuid string @@ -360,6 +367,7 @@ func Test_backup_GetLocation(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -385,6 +393,7 @@ func Test_backup_GetLocation(t *testing.T) { } func Test_backup_Register(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vec *payload.Backup_MetaVector @@ -451,6 +460,7 @@ func Test_backup_Register(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -476,6 +486,7 @@ func Test_backup_Register(t *testing.T) { } func Test_backup_RegisterMultiple(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vecs *payload.Backup_MetaVectors @@ -542,6 +553,7 @@ func Test_backup_RegisterMultiple(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -567,6 +579,7 @@ func Test_backup_RegisterMultiple(t *testing.T) { } func Test_backup_Remove(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uuid string @@ -633,6 +646,7 @@ func Test_backup_Remove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -658,6 +672,7 @@ func Test_backup_Remove(t *testing.T) { } func Test_backup_RemoveMultiple(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uuids []string @@ -724,6 +739,7 @@ func Test_backup_RemoveMultiple(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/backup/service/option_test.go b/pkg/gateway/backup/service/option_test.go index 27be1d2b09..95c449e4a7 100644 --- a/pkg/gateway/backup/service/option_test.go +++ b/pkg/gateway/backup/service/option_test.go @@ -25,6 +25,7 @@ import ( ) func TestWithBackupAddr(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -101,6 +102,7 @@ func TestWithBackupAddr(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -139,6 +141,7 @@ func TestWithBackupAddr(t *testing.T) { } func TestWithBackupClient(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -215,6 +218,7 @@ func TestWithBackupClient(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/backup/usecase/vald_test.go b/pkg/gateway/backup/usecase/vald_test.go index f9d2b2ea9e..9f5cb59e72 100644 --- a/pkg/gateway/backup/usecase/vald_test.go +++ b/pkg/gateway/backup/usecase/vald_test.go @@ -32,6 +32,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { cfg *config.Data } @@ -86,6 +87,7 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -107,6 +109,7 @@ func TestNew(t *testing.T) { } func Test_run_PreStart(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -179,6 +182,7 @@ func Test_run_PreStart(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -207,6 +211,7 @@ func Test_run_PreStart(t *testing.T) { } func Test_run_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -283,6 +288,7 @@ func Test_run_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -311,6 +317,7 @@ func Test_run_Start(t *testing.T) { } func Test_run_PreStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -383,6 +390,7 @@ func Test_run_PreStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -411,6 +419,7 @@ func Test_run_PreStop(t *testing.T) { } func Test_run_Stop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -483,6 +492,7 @@ func Test_run_Stop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -511,6 +521,7 @@ func Test_run_Stop(t *testing.T) { } func Test_run_PostStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -583,6 +594,7 @@ func Test_run_PostStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/filter/config/config_test.go b/pkg/gateway/filter/config/config_test.go index dad9bded04..a2b83c4565 100644 --- a/pkg/gateway/filter/config/config_test.go +++ b/pkg/gateway/filter/config/config_test.go @@ -26,6 +26,7 @@ import ( ) func TestNewConfig(t *testing.T) { + t.Parallel() type args struct { path string } @@ -80,6 +81,7 @@ func TestNewConfig(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/filter/handler/grpc/handler_test.go b/pkg/gateway/filter/handler/grpc/handler_test.go index b9c693d21b..42139a5dea 100644 --- a/pkg/gateway/filter/handler/grpc/handler_test.go +++ b/pkg/gateway/filter/handler/grpc/handler_test.go @@ -33,6 +33,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -83,6 +84,7 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -104,6 +106,7 @@ func TestNew(t *testing.T) { } func Test_server_Exists(t *testing.T) { + t.Parallel() type args struct { ctx context.Context meta *payload.Object_ID @@ -183,6 +186,7 @@ func Test_server_Exists(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -211,6 +215,7 @@ func Test_server_Exists(t *testing.T) { } func Test_server_Search(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Search_Request @@ -290,6 +295,7 @@ func Test_server_Search(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -318,6 +324,7 @@ func Test_server_Search(t *testing.T) { } func Test_server_SearchByID(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Search_IDRequest @@ -397,6 +404,7 @@ func Test_server_SearchByID(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -425,6 +433,7 @@ func Test_server_SearchByID(t *testing.T) { } func Test_server_search(t *testing.T) { + t.Parallel() type args struct { ctx context.Context f func(ctx context.Context, vc vald.ValdClient, copts ...grpc.CallOption) (*payload.Search_Response, error) @@ -504,6 +513,7 @@ func Test_server_search(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -532,6 +542,7 @@ func Test_server_search(t *testing.T) { } func Test_server_StreamSearch(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamSearchServer } @@ -604,6 +615,7 @@ func Test_server_StreamSearch(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -632,6 +644,7 @@ func Test_server_StreamSearch(t *testing.T) { } func Test_server_StreamSearchByID(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamSearchByIDServer } @@ -704,6 +717,7 @@ func Test_server_StreamSearchByID(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -732,6 +746,7 @@ func Test_server_StreamSearchByID(t *testing.T) { } func Test_server_Insert(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vec *payload.Object_Vector @@ -811,6 +826,7 @@ func Test_server_Insert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -839,6 +855,7 @@ func Test_server_Insert(t *testing.T) { } func Test_server_StreamInsert(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamInsertServer } @@ -911,6 +928,7 @@ func Test_server_StreamInsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -939,6 +957,7 @@ func Test_server_StreamInsert(t *testing.T) { } func Test_server_MultiInsert(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vecs *payload.Object_Vectors @@ -1018,6 +1037,7 @@ func Test_server_MultiInsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1046,6 +1066,7 @@ func Test_server_MultiInsert(t *testing.T) { } func Test_server_Update(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vec *payload.Object_Vector @@ -1125,6 +1146,7 @@ func Test_server_Update(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1153,6 +1175,7 @@ func Test_server_Update(t *testing.T) { } func Test_server_StreamUpdate(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamUpdateServer } @@ -1225,6 +1248,7 @@ func Test_server_StreamUpdate(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1253,6 +1277,7 @@ func Test_server_StreamUpdate(t *testing.T) { } func Test_server_MultiUpdate(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vecs *payload.Object_Vectors @@ -1332,6 +1357,7 @@ func Test_server_MultiUpdate(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1360,6 +1386,7 @@ func Test_server_MultiUpdate(t *testing.T) { } func Test_server_Upsert(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vec *payload.Object_Vector @@ -1439,6 +1466,7 @@ func Test_server_Upsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1467,6 +1495,7 @@ func Test_server_Upsert(t *testing.T) { } func Test_server_StreamUpsert(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamUpsertServer } @@ -1539,6 +1568,7 @@ func Test_server_StreamUpsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1567,6 +1597,7 @@ func Test_server_StreamUpsert(t *testing.T) { } func Test_server_MultiUpsert(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vecs *payload.Object_Vectors @@ -1646,6 +1677,7 @@ func Test_server_MultiUpsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1674,6 +1706,7 @@ func Test_server_MultiUpsert(t *testing.T) { } func Test_server_Remove(t *testing.T) { + t.Parallel() type args struct { ctx context.Context id *payload.Object_ID @@ -1753,6 +1786,7 @@ func Test_server_Remove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1781,6 +1815,7 @@ func Test_server_Remove(t *testing.T) { } func Test_server_StreamRemove(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamRemoveServer } @@ -1853,6 +1888,7 @@ func Test_server_StreamRemove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1881,6 +1917,7 @@ func Test_server_StreamRemove(t *testing.T) { } func Test_server_MultiRemove(t *testing.T) { + t.Parallel() type args struct { ctx context.Context ids *payload.Object_IDs @@ -1960,6 +1997,7 @@ func Test_server_MultiRemove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1988,6 +2026,7 @@ func Test_server_MultiRemove(t *testing.T) { } func Test_server_GetObject(t *testing.T) { + t.Parallel() type args struct { ctx context.Context id *payload.Object_ID @@ -2067,6 +2106,7 @@ func Test_server_GetObject(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -2095,6 +2135,7 @@ func Test_server_GetObject(t *testing.T) { } func Test_server_StreamGetObject(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamGetObjectServer } @@ -2167,6 +2208,7 @@ func Test_server_StreamGetObject(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/filter/handler/grpc/option_test.go b/pkg/gateway/filter/handler/grpc/option_test.go index 56d32efb7c..08f11d6766 100644 --- a/pkg/gateway/filter/handler/grpc/option_test.go +++ b/pkg/gateway/filter/handler/grpc/option_test.go @@ -27,6 +27,7 @@ import ( ) func TestWithClient(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -103,6 +104,7 @@ func TestWithClient(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -141,6 +143,7 @@ func TestWithClient(t *testing.T) { } func TestWithFilter(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -217,6 +220,7 @@ func TestWithFilter(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -255,6 +259,7 @@ func TestWithFilter(t *testing.T) { } func TestWithErrGroup(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -331,6 +336,7 @@ func TestWithErrGroup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -369,6 +375,7 @@ func TestWithErrGroup(t *testing.T) { } func TestWithStreamConcurrency(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -445,6 +452,7 @@ func TestWithStreamConcurrency(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/filter/handler/rest/handler_test.go b/pkg/gateway/filter/handler/rest/handler_test.go index ae0f640120..b8f8353265 100644 --- a/pkg/gateway/filter/handler/rest/handler_test.go +++ b/pkg/gateway/filter/handler/rest/handler_test.go @@ -28,6 +28,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -78,6 +79,7 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -99,6 +101,7 @@ func TestNew(t *testing.T) { } func Test_handler_Index(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -166,6 +169,7 @@ func Test_handler_Index(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -190,6 +194,7 @@ func Test_handler_Index(t *testing.T) { } func Test_handler_Search(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -257,6 +262,7 @@ func Test_handler_Search(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -281,6 +287,7 @@ func Test_handler_Search(t *testing.T) { } func Test_handler_SearchByID(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -348,6 +355,7 @@ func Test_handler_SearchByID(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -372,6 +380,7 @@ func Test_handler_SearchByID(t *testing.T) { } func Test_handler_Insert(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -439,6 +448,7 @@ func Test_handler_Insert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -463,6 +473,7 @@ func Test_handler_Insert(t *testing.T) { } func Test_handler_MultiInsert(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -530,6 +541,7 @@ func Test_handler_MultiInsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -554,6 +566,7 @@ func Test_handler_MultiInsert(t *testing.T) { } func Test_handler_Update(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -621,6 +634,7 @@ func Test_handler_Update(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -645,6 +659,7 @@ func Test_handler_Update(t *testing.T) { } func Test_handler_MultiUpdate(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -712,6 +727,7 @@ func Test_handler_MultiUpdate(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -736,6 +752,7 @@ func Test_handler_MultiUpdate(t *testing.T) { } func Test_handler_Remove(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -803,6 +820,7 @@ func Test_handler_Remove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -827,6 +845,7 @@ func Test_handler_Remove(t *testing.T) { } func Test_handler_MultiRemove(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -894,6 +913,7 @@ func Test_handler_MultiRemove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -918,6 +938,7 @@ func Test_handler_MultiRemove(t *testing.T) { } func Test_handler_GetObject(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -985,6 +1006,7 @@ func Test_handler_GetObject(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1009,6 +1031,7 @@ func Test_handler_GetObject(t *testing.T) { } func Test_handler_Exists(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -1076,6 +1099,7 @@ func Test_handler_Exists(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/filter/handler/rest/option_test.go b/pkg/gateway/filter/handler/rest/option_test.go index d45859d8db..851f4f03ce 100644 --- a/pkg/gateway/filter/handler/rest/option_test.go +++ b/pkg/gateway/filter/handler/rest/option_test.go @@ -25,6 +25,7 @@ import ( ) func TestWithVald(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -101,6 +102,7 @@ func TestWithVald(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/filter/router/option_test.go b/pkg/gateway/filter/router/option_test.go index 659ba14d98..e730e658ac 100644 --- a/pkg/gateway/filter/router/option_test.go +++ b/pkg/gateway/filter/router/option_test.go @@ -25,6 +25,7 @@ import ( ) func TestWithHandler(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -101,6 +102,7 @@ func TestWithHandler(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -139,6 +141,7 @@ func TestWithHandler(t *testing.T) { } func TestWithTimeout(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -215,6 +218,7 @@ func TestWithTimeout(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/filter/router/router_test.go b/pkg/gateway/filter/router/router_test.go index 043c1775f1..ec7ce94494 100644 --- a/pkg/gateway/filter/router/router_test.go +++ b/pkg/gateway/filter/router/router_test.go @@ -27,6 +27,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -77,6 +78,7 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/filter/service/filter_test.go b/pkg/gateway/filter/service/filter_test.go index c0015f03c0..74cd26c12c 100644 --- a/pkg/gateway/filter/service/filter_test.go +++ b/pkg/gateway/filter/service/filter_test.go @@ -30,6 +30,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -84,6 +85,7 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -105,6 +107,7 @@ func TestNew(t *testing.T) { } func Test_filter_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -175,6 +178,7 @@ func Test_filter_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -201,6 +205,7 @@ func Test_filter_Start(t *testing.T) { } func Test_filter_IngressSearchVector(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vec []float32 @@ -274,6 +279,7 @@ func Test_filter_IngressSearchVector(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -300,6 +306,7 @@ func Test_filter_IngressSearchVector(t *testing.T) { } func Test_filter_IngressInsertVector(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vec []float32 @@ -373,6 +380,7 @@ func Test_filter_IngressInsertVector(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -399,6 +407,7 @@ func Test_filter_IngressInsertVector(t *testing.T) { } func Test_filter_IngressUpdateVector(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vec []float32 @@ -472,6 +481,7 @@ func Test_filter_IngressUpdateVector(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -498,6 +508,7 @@ func Test_filter_IngressUpdateVector(t *testing.T) { } func Test_filter_IngressUpsertVector(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vec []float32 @@ -571,6 +582,7 @@ func Test_filter_IngressUpsertVector(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -597,6 +609,7 @@ func Test_filter_IngressUpsertVector(t *testing.T) { } func Test_filter_IngressObject(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vec []float32 @@ -670,6 +683,7 @@ func Test_filter_IngressObject(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -696,6 +710,7 @@ func Test_filter_IngressObject(t *testing.T) { } func Test_filter_EgressVectors(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vecs []*payload.Object_Distance @@ -769,6 +784,7 @@ func Test_filter_EgressVectors(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/filter/usecase/vald_test.go b/pkg/gateway/filter/usecase/vald_test.go index 0ccc5a5c92..b38e83e8a4 100644 --- a/pkg/gateway/filter/usecase/vald_test.go +++ b/pkg/gateway/filter/usecase/vald_test.go @@ -32,6 +32,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { cfg *config.Data } @@ -86,6 +87,7 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -107,6 +109,7 @@ func TestNew(t *testing.T) { } func Test_run_PreStart(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -179,6 +182,7 @@ func Test_run_PreStart(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -207,6 +211,7 @@ func Test_run_PreStart(t *testing.T) { } func Test_run_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -283,6 +288,7 @@ func Test_run_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -311,6 +317,7 @@ func Test_run_Start(t *testing.T) { } func Test_run_PreStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -383,6 +390,7 @@ func Test_run_PreStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -411,6 +419,7 @@ func Test_run_PreStop(t *testing.T) { } func Test_run_Stop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -483,6 +492,7 @@ func Test_run_Stop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -511,6 +521,7 @@ func Test_run_Stop(t *testing.T) { } func Test_run_PostStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -583,6 +594,7 @@ func Test_run_PostStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/lb/config/config_test.go b/pkg/gateway/lb/config/config_test.go index 6f1e2076f9..9a2a62be78 100644 --- a/pkg/gateway/lb/config/config_test.go +++ b/pkg/gateway/lb/config/config_test.go @@ -26,6 +26,7 @@ import ( ) func TestNewConfig(t *testing.T) { + t.Parallel() type args struct { path string } @@ -80,6 +81,7 @@ func TestNewConfig(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/lb/handler/grpc/handler_test.go b/pkg/gateway/lb/handler/grpc/handler_test.go index 879a4a9248..646cf3f5e5 100644 --- a/pkg/gateway/lb/handler/grpc/handler_test.go +++ b/pkg/gateway/lb/handler/grpc/handler_test.go @@ -33,6 +33,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -83,6 +84,7 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -104,6 +106,7 @@ func TestNew(t *testing.T) { } func Test_server_Exists(t *testing.T) { + t.Parallel() type args struct { ctx context.Context meta *payload.Object_ID @@ -112,6 +115,7 @@ func Test_server_Exists(t *testing.T) { eg errgroup.Group gateway service.Gateway timeout time.Duration + strict bool replica int streamConcurrency int } @@ -150,6 +154,7 @@ func Test_server_Exists(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -171,6 +176,7 @@ func Test_server_Exists(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -183,6 +189,7 @@ func Test_server_Exists(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -197,6 +204,7 @@ func Test_server_Exists(t *testing.T) { eg: test.fields.eg, gateway: test.fields.gateway, timeout: test.fields.timeout, + strict: test.fields.strict, replica: test.fields.replica, streamConcurrency: test.fields.streamConcurrency, } @@ -211,6 +219,7 @@ func Test_server_Exists(t *testing.T) { } func Test_server_Search(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Search_Request @@ -219,6 +228,7 @@ func Test_server_Search(t *testing.T) { eg errgroup.Group gateway service.Gateway timeout time.Duration + strict bool replica int streamConcurrency int } @@ -257,6 +267,7 @@ func Test_server_Search(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -278,6 +289,7 @@ func Test_server_Search(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -290,6 +302,7 @@ func Test_server_Search(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -304,6 +317,7 @@ func Test_server_Search(t *testing.T) { eg: test.fields.eg, gateway: test.fields.gateway, timeout: test.fields.timeout, + strict: test.fields.strict, replica: test.fields.replica, streamConcurrency: test.fields.streamConcurrency, } @@ -318,6 +332,7 @@ func Test_server_Search(t *testing.T) { } func Test_server_SearchByID(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Search_IDRequest @@ -326,6 +341,7 @@ func Test_server_SearchByID(t *testing.T) { eg errgroup.Group gateway service.Gateway timeout time.Duration + strict bool replica int streamConcurrency int } @@ -364,6 +380,7 @@ func Test_server_SearchByID(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -385,6 +402,7 @@ func Test_server_SearchByID(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -397,6 +415,7 @@ func Test_server_SearchByID(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -411,6 +430,7 @@ func Test_server_SearchByID(t *testing.T) { eg: test.fields.eg, gateway: test.fields.gateway, timeout: test.fields.timeout, + strict: test.fields.strict, replica: test.fields.replica, streamConcurrency: test.fields.streamConcurrency, } @@ -425,6 +445,7 @@ func Test_server_SearchByID(t *testing.T) { } func Test_server_search(t *testing.T) { + t.Parallel() type args struct { ctx context.Context cfg *payload.Search_Config @@ -434,6 +455,7 @@ func Test_server_search(t *testing.T) { eg errgroup.Group gateway service.Gateway timeout time.Duration + strict bool replica int streamConcurrency int } @@ -473,6 +495,7 @@ func Test_server_search(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -495,6 +518,7 @@ func Test_server_search(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -507,6 +531,7 @@ func Test_server_search(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -521,6 +546,7 @@ func Test_server_search(t *testing.T) { eg: test.fields.eg, gateway: test.fields.gateway, timeout: test.fields.timeout, + strict: test.fields.strict, replica: test.fields.replica, streamConcurrency: test.fields.streamConcurrency, } @@ -535,6 +561,7 @@ func Test_server_search(t *testing.T) { } func Test_server_StreamSearch(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamSearchServer } @@ -542,6 +569,7 @@ func Test_server_StreamSearch(t *testing.T) { eg errgroup.Group gateway service.Gateway timeout time.Duration + strict bool replica int streamConcurrency int } @@ -575,6 +603,7 @@ func Test_server_StreamSearch(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -595,6 +624,7 @@ func Test_server_StreamSearch(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -607,6 +637,7 @@ func Test_server_StreamSearch(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -621,6 +652,7 @@ func Test_server_StreamSearch(t *testing.T) { eg: test.fields.eg, gateway: test.fields.gateway, timeout: test.fields.timeout, + strict: test.fields.strict, replica: test.fields.replica, streamConcurrency: test.fields.streamConcurrency, } @@ -635,6 +667,7 @@ func Test_server_StreamSearch(t *testing.T) { } func Test_server_StreamSearchByID(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamSearchByIDServer } @@ -642,6 +675,7 @@ func Test_server_StreamSearchByID(t *testing.T) { eg errgroup.Group gateway service.Gateway timeout time.Duration + strict bool replica int streamConcurrency int } @@ -675,6 +709,7 @@ func Test_server_StreamSearchByID(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -695,6 +730,7 @@ func Test_server_StreamSearchByID(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -707,6 +743,7 @@ func Test_server_StreamSearchByID(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -721,6 +758,7 @@ func Test_server_StreamSearchByID(t *testing.T) { eg: test.fields.eg, gateway: test.fields.gateway, timeout: test.fields.timeout, + strict: test.fields.strict, replica: test.fields.replica, streamConcurrency: test.fields.streamConcurrency, } @@ -735,6 +773,7 @@ func Test_server_StreamSearchByID(t *testing.T) { } func Test_server_Insert(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vec *payload.Object_Vector @@ -743,6 +782,7 @@ func Test_server_Insert(t *testing.T) { eg errgroup.Group gateway service.Gateway timeout time.Duration + strict bool replica int streamConcurrency int } @@ -781,6 +821,7 @@ func Test_server_Insert(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -802,6 +843,7 @@ func Test_server_Insert(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -814,6 +856,7 @@ func Test_server_Insert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -828,6 +871,7 @@ func Test_server_Insert(t *testing.T) { eg: test.fields.eg, gateway: test.fields.gateway, timeout: test.fields.timeout, + strict: test.fields.strict, replica: test.fields.replica, streamConcurrency: test.fields.streamConcurrency, } @@ -842,6 +886,7 @@ func Test_server_Insert(t *testing.T) { } func Test_server_StreamInsert(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamInsertServer } @@ -849,6 +894,7 @@ func Test_server_StreamInsert(t *testing.T) { eg errgroup.Group gateway service.Gateway timeout time.Duration + strict bool replica int streamConcurrency int } @@ -882,6 +928,7 @@ func Test_server_StreamInsert(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -902,6 +949,7 @@ func Test_server_StreamInsert(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -914,6 +962,7 @@ func Test_server_StreamInsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -928,6 +977,7 @@ func Test_server_StreamInsert(t *testing.T) { eg: test.fields.eg, gateway: test.fields.gateway, timeout: test.fields.timeout, + strict: test.fields.strict, replica: test.fields.replica, streamConcurrency: test.fields.streamConcurrency, } @@ -942,6 +992,7 @@ func Test_server_StreamInsert(t *testing.T) { } func Test_server_MultiInsert(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vecs *payload.Object_Vectors @@ -950,12 +1001,13 @@ func Test_server_MultiInsert(t *testing.T) { eg errgroup.Group gateway service.Gateway timeout time.Duration + strict bool replica int streamConcurrency int } type want struct { - wantRes *payload.Object_Locations - err error + wantLocs *payload.Object_Locations + err error } type test struct { name string @@ -966,12 +1018,12 @@ func Test_server_MultiInsert(t *testing.T) { beforeFunc func(args) afterFunc func(args) } - defaultCheckFunc := func(w want, gotRes *payload.Object_Locations, err error) error { + defaultCheckFunc := func(w want, gotLocs *payload.Object_Locations, err error) error { if !errors.Is(err, w.err) { return errors.Errorf("got error = %v, want %v", err, w.err) } - if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + if !reflect.DeepEqual(gotLocs, w.wantLocs) { + return errors.Errorf("got = %v, want %v", gotLocs, w.wantLocs) } return nil } @@ -988,6 +1040,7 @@ func Test_server_MultiInsert(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -1009,6 +1062,7 @@ func Test_server_MultiInsert(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -1021,6 +1075,7 @@ func Test_server_MultiInsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1035,12 +1090,13 @@ func Test_server_MultiInsert(t *testing.T) { eg: test.fields.eg, gateway: test.fields.gateway, timeout: test.fields.timeout, + strict: test.fields.strict, replica: test.fields.replica, streamConcurrency: test.fields.streamConcurrency, } - gotRes, err := s.MultiInsert(test.args.ctx, test.args.vecs) - if err := test.checkFunc(test.want, gotRes, err); err != nil { + gotLocs, err := s.MultiInsert(test.args.ctx, test.args.vecs) + if err := test.checkFunc(test.want, gotLocs, err); err != nil { tt.Errorf("error = %v", err) } @@ -1049,6 +1105,7 @@ func Test_server_MultiInsert(t *testing.T) { } func Test_server_Update(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vec *payload.Object_Vector @@ -1057,6 +1114,7 @@ func Test_server_Update(t *testing.T) { eg errgroup.Group gateway service.Gateway timeout time.Duration + strict bool replica int streamConcurrency int } @@ -1095,6 +1153,7 @@ func Test_server_Update(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -1116,6 +1175,7 @@ func Test_server_Update(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -1128,6 +1188,7 @@ func Test_server_Update(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1142,6 +1203,7 @@ func Test_server_Update(t *testing.T) { eg: test.fields.eg, gateway: test.fields.gateway, timeout: test.fields.timeout, + strict: test.fields.strict, replica: test.fields.replica, streamConcurrency: test.fields.streamConcurrency, } @@ -1156,6 +1218,7 @@ func Test_server_Update(t *testing.T) { } func Test_server_StreamUpdate(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamUpdateServer } @@ -1163,6 +1226,7 @@ func Test_server_StreamUpdate(t *testing.T) { eg errgroup.Group gateway service.Gateway timeout time.Duration + strict bool replica int streamConcurrency int } @@ -1196,6 +1260,7 @@ func Test_server_StreamUpdate(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -1216,6 +1281,7 @@ func Test_server_StreamUpdate(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -1228,6 +1294,7 @@ func Test_server_StreamUpdate(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1242,6 +1309,7 @@ func Test_server_StreamUpdate(t *testing.T) { eg: test.fields.eg, gateway: test.fields.gateway, timeout: test.fields.timeout, + strict: test.fields.strict, replica: test.fields.replica, streamConcurrency: test.fields.streamConcurrency, } @@ -1256,6 +1324,7 @@ func Test_server_StreamUpdate(t *testing.T) { } func Test_server_MultiUpdate(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vecs *payload.Object_Vectors @@ -1264,6 +1333,7 @@ func Test_server_MultiUpdate(t *testing.T) { eg errgroup.Group gateway service.Gateway timeout time.Duration + strict bool replica int streamConcurrency int } @@ -1302,6 +1372,7 @@ func Test_server_MultiUpdate(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -1323,6 +1394,7 @@ func Test_server_MultiUpdate(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -1335,6 +1407,7 @@ func Test_server_MultiUpdate(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1349,6 +1422,7 @@ func Test_server_MultiUpdate(t *testing.T) { eg: test.fields.eg, gateway: test.fields.gateway, timeout: test.fields.timeout, + strict: test.fields.strict, replica: test.fields.replica, streamConcurrency: test.fields.streamConcurrency, } @@ -1363,6 +1437,7 @@ func Test_server_MultiUpdate(t *testing.T) { } func Test_server_Upsert(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vec *payload.Object_Vector @@ -1371,12 +1446,13 @@ func Test_server_Upsert(t *testing.T) { eg errgroup.Group gateway service.Gateway timeout time.Duration + strict bool replica int streamConcurrency int } type want struct { - want *payload.Object_Location - err error + wantLoc *payload.Object_Location + err error } type test struct { name string @@ -1387,12 +1463,12 @@ func Test_server_Upsert(t *testing.T) { beforeFunc func(args) afterFunc func(args) } - defaultCheckFunc := func(w want, got *payload.Object_Location, err error) error { + defaultCheckFunc := func(w want, gotLoc *payload.Object_Location, err error) error { if !errors.Is(err, w.err) { return errors.Errorf("got error = %v, want %v", err, w.err) } - if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + if !reflect.DeepEqual(gotLoc, w.wantLoc) { + return errors.Errorf("got = %v, want %v", gotLoc, w.wantLoc) } return nil } @@ -1409,6 +1485,7 @@ func Test_server_Upsert(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -1430,6 +1507,7 @@ func Test_server_Upsert(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -1442,6 +1520,7 @@ func Test_server_Upsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1456,12 +1535,13 @@ func Test_server_Upsert(t *testing.T) { eg: test.fields.eg, gateway: test.fields.gateway, timeout: test.fields.timeout, + strict: test.fields.strict, replica: test.fields.replica, streamConcurrency: test.fields.streamConcurrency, } - got, err := s.Upsert(test.args.ctx, test.args.vec) - if err := test.checkFunc(test.want, got, err); err != nil { + gotLoc, err := s.Upsert(test.args.ctx, test.args.vec) + if err := test.checkFunc(test.want, gotLoc, err); err != nil { tt.Errorf("error = %v", err) } @@ -1470,6 +1550,7 @@ func Test_server_Upsert(t *testing.T) { } func Test_server_StreamUpsert(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamUpsertServer } @@ -1477,6 +1558,7 @@ func Test_server_StreamUpsert(t *testing.T) { eg errgroup.Group gateway service.Gateway timeout time.Duration + strict bool replica int streamConcurrency int } @@ -1510,6 +1592,7 @@ func Test_server_StreamUpsert(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -1530,6 +1613,7 @@ func Test_server_StreamUpsert(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -1542,6 +1626,7 @@ func Test_server_StreamUpsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1556,6 +1641,7 @@ func Test_server_StreamUpsert(t *testing.T) { eg: test.fields.eg, gateway: test.fields.gateway, timeout: test.fields.timeout, + strict: test.fields.strict, replica: test.fields.replica, streamConcurrency: test.fields.streamConcurrency, } @@ -1570,6 +1656,7 @@ func Test_server_StreamUpsert(t *testing.T) { } func Test_server_MultiUpsert(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vecs *payload.Object_Vectors @@ -1578,12 +1665,13 @@ func Test_server_MultiUpsert(t *testing.T) { eg errgroup.Group gateway service.Gateway timeout time.Duration + strict bool replica int streamConcurrency int } type want struct { - want *payload.Object_Locations - err error + wantLocs *payload.Object_Locations + err error } type test struct { name string @@ -1594,12 +1682,12 @@ func Test_server_MultiUpsert(t *testing.T) { beforeFunc func(args) afterFunc func(args) } - defaultCheckFunc := func(w want, got *payload.Object_Locations, err error) error { + defaultCheckFunc := func(w want, gotLocs *payload.Object_Locations, err error) error { if !errors.Is(err, w.err) { return errors.Errorf("got error = %v, want %v", err, w.err) } - if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + if !reflect.DeepEqual(gotLocs, w.wantLocs) { + return errors.Errorf("got = %v, want %v", gotLocs, w.wantLocs) } return nil } @@ -1616,6 +1704,7 @@ func Test_server_MultiUpsert(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -1637,6 +1726,7 @@ func Test_server_MultiUpsert(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -1649,6 +1739,7 @@ func Test_server_MultiUpsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1663,12 +1754,13 @@ func Test_server_MultiUpsert(t *testing.T) { eg: test.fields.eg, gateway: test.fields.gateway, timeout: test.fields.timeout, + strict: test.fields.strict, replica: test.fields.replica, streamConcurrency: test.fields.streamConcurrency, } - got, err := s.MultiUpsert(test.args.ctx, test.args.vecs) - if err := test.checkFunc(test.want, got, err); err != nil { + gotLocs, err := s.MultiUpsert(test.args.ctx, test.args.vecs) + if err := test.checkFunc(test.want, gotLocs, err); err != nil { tt.Errorf("error = %v", err) } @@ -1677,6 +1769,7 @@ func Test_server_MultiUpsert(t *testing.T) { } func Test_server_Remove(t *testing.T) { + t.Parallel() type args struct { ctx context.Context id *payload.Object_ID @@ -1685,12 +1778,13 @@ func Test_server_Remove(t *testing.T) { eg errgroup.Group gateway service.Gateway timeout time.Duration + strict bool replica int streamConcurrency int } type want struct { - want *payload.Object_Location - err error + wantLocs *payload.Object_Location + err error } type test struct { name string @@ -1701,12 +1795,12 @@ func Test_server_Remove(t *testing.T) { beforeFunc func(args) afterFunc func(args) } - defaultCheckFunc := func(w want, got *payload.Object_Location, err error) error { + defaultCheckFunc := func(w want, gotLocs *payload.Object_Location, err error) error { if !errors.Is(err, w.err) { return errors.Errorf("got error = %v, want %v", err, w.err) } - if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + if !reflect.DeepEqual(gotLocs, w.wantLocs) { + return errors.Errorf("got = %v, want %v", gotLocs, w.wantLocs) } return nil } @@ -1723,6 +1817,7 @@ func Test_server_Remove(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -1744,6 +1839,7 @@ func Test_server_Remove(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -1756,6 +1852,7 @@ func Test_server_Remove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1770,12 +1867,13 @@ func Test_server_Remove(t *testing.T) { eg: test.fields.eg, gateway: test.fields.gateway, timeout: test.fields.timeout, + strict: test.fields.strict, replica: test.fields.replica, streamConcurrency: test.fields.streamConcurrency, } - got, err := s.Remove(test.args.ctx, test.args.id) - if err := test.checkFunc(test.want, got, err); err != nil { + gotLocs, err := s.Remove(test.args.ctx, test.args.id) + if err := test.checkFunc(test.want, gotLocs, err); err != nil { tt.Errorf("error = %v", err) } @@ -1784,6 +1882,7 @@ func Test_server_Remove(t *testing.T) { } func Test_server_StreamRemove(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamRemoveServer } @@ -1791,6 +1890,7 @@ func Test_server_StreamRemove(t *testing.T) { eg errgroup.Group gateway service.Gateway timeout time.Duration + strict bool replica int streamConcurrency int } @@ -1824,6 +1924,7 @@ func Test_server_StreamRemove(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -1844,6 +1945,7 @@ func Test_server_StreamRemove(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -1856,6 +1958,7 @@ func Test_server_StreamRemove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1870,6 +1973,7 @@ func Test_server_StreamRemove(t *testing.T) { eg: test.fields.eg, gateway: test.fields.gateway, timeout: test.fields.timeout, + strict: test.fields.strict, replica: test.fields.replica, streamConcurrency: test.fields.streamConcurrency, } @@ -1884,6 +1988,7 @@ func Test_server_StreamRemove(t *testing.T) { } func Test_server_MultiRemove(t *testing.T) { + t.Parallel() type args struct { ctx context.Context ids *payload.Object_IDs @@ -1892,12 +1997,13 @@ func Test_server_MultiRemove(t *testing.T) { eg errgroup.Group gateway service.Gateway timeout time.Duration + strict bool replica int streamConcurrency int } type want struct { - wantRes *payload.Object_Locations - err error + wantLocs *payload.Object_Locations + err error } type test struct { name string @@ -1908,12 +2014,12 @@ func Test_server_MultiRemove(t *testing.T) { beforeFunc func(args) afterFunc func(args) } - defaultCheckFunc := func(w want, gotRes *payload.Object_Locations, err error) error { + defaultCheckFunc := func(w want, gotLocs *payload.Object_Locations, err error) error { if !errors.Is(err, w.err) { return errors.Errorf("got error = %v, want %v", err, w.err) } - if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + if !reflect.DeepEqual(gotLocs, w.wantLocs) { + return errors.Errorf("got = %v, want %v", gotLocs, w.wantLocs) } return nil } @@ -1930,6 +2036,7 @@ func Test_server_MultiRemove(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -1951,6 +2058,7 @@ func Test_server_MultiRemove(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -1963,6 +2071,7 @@ func Test_server_MultiRemove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1977,12 +2086,13 @@ func Test_server_MultiRemove(t *testing.T) { eg: test.fields.eg, gateway: test.fields.gateway, timeout: test.fields.timeout, + strict: test.fields.strict, replica: test.fields.replica, streamConcurrency: test.fields.streamConcurrency, } - gotRes, err := s.MultiRemove(test.args.ctx, test.args.ids) - if err := test.checkFunc(test.want, gotRes, err); err != nil { + gotLocs, err := s.MultiRemove(test.args.ctx, test.args.ids) + if err := test.checkFunc(test.want, gotLocs, err); err != nil { tt.Errorf("error = %v", err) } @@ -1991,6 +2101,7 @@ func Test_server_MultiRemove(t *testing.T) { } func Test_server_GetObject(t *testing.T) { + t.Parallel() type args struct { ctx context.Context id *payload.Object_ID @@ -1999,6 +2110,7 @@ func Test_server_GetObject(t *testing.T) { eg errgroup.Group gateway service.Gateway timeout time.Duration + strict bool replica int streamConcurrency int } @@ -2037,6 +2149,7 @@ func Test_server_GetObject(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -2058,6 +2171,7 @@ func Test_server_GetObject(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -2070,6 +2184,7 @@ func Test_server_GetObject(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -2084,6 +2199,7 @@ func Test_server_GetObject(t *testing.T) { eg: test.fields.eg, gateway: test.fields.gateway, timeout: test.fields.timeout, + strict: test.fields.strict, replica: test.fields.replica, streamConcurrency: test.fields.streamConcurrency, } @@ -2098,6 +2214,7 @@ func Test_server_GetObject(t *testing.T) { } func Test_server_StreamGetObject(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamGetObjectServer } @@ -2105,6 +2222,7 @@ func Test_server_StreamGetObject(t *testing.T) { eg errgroup.Group gateway service.Gateway timeout time.Duration + strict bool replica int streamConcurrency int } @@ -2138,6 +2256,7 @@ func Test_server_StreamGetObject(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -2158,6 +2277,7 @@ func Test_server_StreamGetObject(t *testing.T) { eg: nil, gateway: nil, timeout: nil, + strict: false, replica: 0, streamConcurrency: 0, }, @@ -2170,6 +2290,7 @@ func Test_server_StreamGetObject(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -2184,6 +2305,7 @@ func Test_server_StreamGetObject(t *testing.T) { eg: test.fields.eg, gateway: test.fields.gateway, timeout: test.fields.timeout, + strict: test.fields.strict, replica: test.fields.replica, streamConcurrency: test.fields.streamConcurrency, } diff --git a/pkg/gateway/lb/handler/grpc/option_test.go b/pkg/gateway/lb/handler/grpc/option_test.go index 5582837c27..1cb01868ab 100644 --- a/pkg/gateway/lb/handler/grpc/option_test.go +++ b/pkg/gateway/lb/handler/grpc/option_test.go @@ -26,6 +26,7 @@ import ( ) func TestWithGateway(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -102,6 +103,7 @@ func TestWithGateway(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -140,6 +142,7 @@ func TestWithGateway(t *testing.T) { } func TestWithErrGroup(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -216,6 +219,7 @@ func TestWithErrGroup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -254,6 +258,7 @@ func TestWithErrGroup(t *testing.T) { } func TestWithTimeout(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -330,6 +335,7 @@ func TestWithTimeout(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -368,6 +374,7 @@ func TestWithTimeout(t *testing.T) { } func TestWithReplicationCount(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -444,6 +451,7 @@ func TestWithReplicationCount(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -482,6 +490,7 @@ func TestWithReplicationCount(t *testing.T) { } func TestWithStreamConcurrency(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -558,6 +567,7 @@ func TestWithStreamConcurrency(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/lb/handler/grpc/visitlist_test.go b/pkg/gateway/lb/handler/grpc/visitlist_test.go index 718dd217d7..b717ba2de2 100644 --- a/pkg/gateway/lb/handler/grpc/visitlist_test.go +++ b/pkg/gateway/lb/handler/grpc/visitlist_test.go @@ -27,6 +27,7 @@ import ( ) func Test_visitList_Load(t *testing.T) { + t.Parallel() type args struct { key string } @@ -100,6 +101,7 @@ func Test_visitList_Load(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -127,6 +129,7 @@ func Test_visitList_Load(t *testing.T) { } func Test_visitList_Store(t *testing.T) { + t.Parallel() type args struct { key string value bool @@ -195,6 +198,7 @@ func Test_visitList_Store(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/lb/handler/rest/handler_test.go b/pkg/gateway/lb/handler/rest/handler_test.go index ae0f640120..b8f8353265 100644 --- a/pkg/gateway/lb/handler/rest/handler_test.go +++ b/pkg/gateway/lb/handler/rest/handler_test.go @@ -28,6 +28,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -78,6 +79,7 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -99,6 +101,7 @@ func TestNew(t *testing.T) { } func Test_handler_Index(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -166,6 +169,7 @@ func Test_handler_Index(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -190,6 +194,7 @@ func Test_handler_Index(t *testing.T) { } func Test_handler_Search(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -257,6 +262,7 @@ func Test_handler_Search(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -281,6 +287,7 @@ func Test_handler_Search(t *testing.T) { } func Test_handler_SearchByID(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -348,6 +355,7 @@ func Test_handler_SearchByID(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -372,6 +380,7 @@ func Test_handler_SearchByID(t *testing.T) { } func Test_handler_Insert(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -439,6 +448,7 @@ func Test_handler_Insert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -463,6 +473,7 @@ func Test_handler_Insert(t *testing.T) { } func Test_handler_MultiInsert(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -530,6 +541,7 @@ func Test_handler_MultiInsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -554,6 +566,7 @@ func Test_handler_MultiInsert(t *testing.T) { } func Test_handler_Update(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -621,6 +634,7 @@ func Test_handler_Update(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -645,6 +659,7 @@ func Test_handler_Update(t *testing.T) { } func Test_handler_MultiUpdate(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -712,6 +727,7 @@ func Test_handler_MultiUpdate(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -736,6 +752,7 @@ func Test_handler_MultiUpdate(t *testing.T) { } func Test_handler_Remove(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -803,6 +820,7 @@ func Test_handler_Remove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -827,6 +845,7 @@ func Test_handler_Remove(t *testing.T) { } func Test_handler_MultiRemove(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -894,6 +913,7 @@ func Test_handler_MultiRemove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -918,6 +938,7 @@ func Test_handler_MultiRemove(t *testing.T) { } func Test_handler_GetObject(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -985,6 +1006,7 @@ func Test_handler_GetObject(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1009,6 +1031,7 @@ func Test_handler_GetObject(t *testing.T) { } func Test_handler_Exists(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -1076,6 +1099,7 @@ func Test_handler_Exists(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/lb/handler/rest/option_test.go b/pkg/gateway/lb/handler/rest/option_test.go index d45859d8db..851f4f03ce 100644 --- a/pkg/gateway/lb/handler/rest/option_test.go +++ b/pkg/gateway/lb/handler/rest/option_test.go @@ -25,6 +25,7 @@ import ( ) func TestWithVald(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -101,6 +102,7 @@ func TestWithVald(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/lb/router/option_test.go b/pkg/gateway/lb/router/option_test.go index 154c3593f3..9b836d001b 100644 --- a/pkg/gateway/lb/router/option_test.go +++ b/pkg/gateway/lb/router/option_test.go @@ -25,6 +25,7 @@ import ( ) func TestWithHandler(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -101,6 +102,7 @@ func TestWithHandler(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -139,6 +141,7 @@ func TestWithHandler(t *testing.T) { } func TestWithTimeout(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -215,6 +218,7 @@ func TestWithTimeout(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/lb/router/router_test.go b/pkg/gateway/lb/router/router_test.go index 043c1775f1..ec7ce94494 100644 --- a/pkg/gateway/lb/router/router_test.go +++ b/pkg/gateway/lb/router/router_test.go @@ -27,6 +27,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -77,6 +78,7 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/lb/service/gateway_option_test.go b/pkg/gateway/lb/service/gateway_option_test.go index 6ac318982a..6adb0e6a1b 100644 --- a/pkg/gateway/lb/service/gateway_option_test.go +++ b/pkg/gateway/lb/service/gateway_option_test.go @@ -26,6 +26,7 @@ import ( ) func TestWithDiscoverer(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -102,6 +103,7 @@ func TestWithDiscoverer(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -140,6 +142,7 @@ func TestWithDiscoverer(t *testing.T) { } func TestWithErrGroup(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -216,6 +219,7 @@ func TestWithErrGroup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/lb/service/gateway_test.go b/pkg/gateway/lb/service/gateway_test.go index 17cda98829..5199ccbadd 100644 --- a/pkg/gateway/lb/service/gateway_test.go +++ b/pkg/gateway/lb/service/gateway_test.go @@ -31,6 +31,7 @@ import ( ) func TestNewGateway(t *testing.T) { + t.Parallel() type args struct { opts []GWOption } @@ -85,6 +86,7 @@ func TestNewGateway(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -106,6 +108,7 @@ func TestNewGateway(t *testing.T) { } func Test_gateway_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -173,6 +176,7 @@ func Test_gateway_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -198,6 +202,7 @@ func Test_gateway_Start(t *testing.T) { } func Test_gateway_BroadCast(t *testing.T) { + t.Parallel() type args struct { ctx context.Context f func(ctx context.Context, target string, ac vald.ValdClient, copts ...grpc.CallOption) error @@ -264,6 +269,7 @@ func Test_gateway_BroadCast(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -289,6 +295,7 @@ func Test_gateway_BroadCast(t *testing.T) { } func Test_gateway_Do(t *testing.T) { + t.Parallel() type args struct { ctx context.Context f func(ctx context.Context, target string, ac vald.ValdClient, copts ...grpc.CallOption) error @@ -355,6 +362,7 @@ func Test_gateway_Do(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -380,6 +388,7 @@ func Test_gateway_Do(t *testing.T) { } func Test_gateway_DoMulti(t *testing.T) { + t.Parallel() type args struct { ctx context.Context num int @@ -449,6 +458,7 @@ func Test_gateway_DoMulti(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -474,6 +484,7 @@ func Test_gateway_DoMulti(t *testing.T) { } func Test_gateway_GetAgentCount(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -537,6 +548,7 @@ func Test_gateway_GetAgentCount(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/lb/usecase/vald_test.go b/pkg/gateway/lb/usecase/vald_test.go index 2cdaf7417a..9e79a8d82e 100644 --- a/pkg/gateway/lb/usecase/vald_test.go +++ b/pkg/gateway/lb/usecase/vald_test.go @@ -32,6 +32,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { cfg *config.Data } @@ -86,6 +87,7 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -107,6 +109,7 @@ func TestNew(t *testing.T) { } func Test_run_PreStart(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -179,6 +182,7 @@ func Test_run_PreStart(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -207,6 +211,7 @@ func Test_run_PreStart(t *testing.T) { } func Test_run_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -283,6 +288,7 @@ func Test_run_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -311,6 +317,7 @@ func Test_run_Start(t *testing.T) { } func Test_run_PreStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -383,6 +390,7 @@ func Test_run_PreStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -411,6 +419,7 @@ func Test_run_PreStop(t *testing.T) { } func Test_run_Stop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -483,6 +492,7 @@ func Test_run_Stop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -511,6 +521,7 @@ func Test_run_Stop(t *testing.T) { } func Test_run_PostStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -583,6 +594,7 @@ func Test_run_PostStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/meta/config/config_test.go b/pkg/gateway/meta/config/config_test.go index 6f1e2076f9..9a2a62be78 100644 --- a/pkg/gateway/meta/config/config_test.go +++ b/pkg/gateway/meta/config/config_test.go @@ -26,6 +26,7 @@ import ( ) func TestNewConfig(t *testing.T) { + t.Parallel() type args struct { path string } @@ -80,6 +81,7 @@ func TestNewConfig(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/meta/handler/grpc/handler_test.go b/pkg/gateway/meta/handler/grpc/handler_test.go index 359e273126..96e5a96452 100644 --- a/pkg/gateway/meta/handler/grpc/handler_test.go +++ b/pkg/gateway/meta/handler/grpc/handler_test.go @@ -33,6 +33,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -83,6 +84,7 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -104,6 +106,7 @@ func TestNew(t *testing.T) { } func Test_server_Exists(t *testing.T) { + t.Parallel() type args struct { ctx context.Context meta *payload.Object_ID @@ -183,6 +186,7 @@ func Test_server_Exists(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -211,6 +215,7 @@ func Test_server_Exists(t *testing.T) { } func Test_server_Search(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Search_Request @@ -290,6 +295,7 @@ func Test_server_Search(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -318,6 +324,7 @@ func Test_server_Search(t *testing.T) { } func Test_server_SearchByID(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Search_IDRequest @@ -397,6 +404,7 @@ func Test_server_SearchByID(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -425,6 +433,7 @@ func Test_server_SearchByID(t *testing.T) { } func Test_server_search(t *testing.T) { + t.Parallel() type args struct { ctx context.Context f func(ctx context.Context, vc vald.ValdClient, copts ...grpc.CallOption) (*payload.Search_Response, error) @@ -504,6 +513,7 @@ func Test_server_search(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -532,6 +542,7 @@ func Test_server_search(t *testing.T) { } func Test_server_StreamSearch(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamSearchServer } @@ -604,6 +615,7 @@ func Test_server_StreamSearch(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -632,6 +644,7 @@ func Test_server_StreamSearch(t *testing.T) { } func Test_server_StreamSearchByID(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamSearchByIDServer } @@ -704,6 +717,7 @@ func Test_server_StreamSearchByID(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -732,6 +746,7 @@ func Test_server_StreamSearchByID(t *testing.T) { } func Test_server_Insert(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vec *payload.Object_Vector @@ -811,6 +826,7 @@ func Test_server_Insert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -839,6 +855,7 @@ func Test_server_Insert(t *testing.T) { } func Test_server_StreamInsert(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamInsertServer } @@ -911,6 +928,7 @@ func Test_server_StreamInsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -939,6 +957,7 @@ func Test_server_StreamInsert(t *testing.T) { } func Test_server_MultiInsert(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vecs *payload.Object_Vectors @@ -1018,6 +1037,7 @@ func Test_server_MultiInsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1046,6 +1066,7 @@ func Test_server_MultiInsert(t *testing.T) { } func Test_server_Update(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vec *payload.Object_Vector @@ -1125,6 +1146,7 @@ func Test_server_Update(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1153,6 +1175,7 @@ func Test_server_Update(t *testing.T) { } func Test_server_StreamUpdate(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamUpdateServer } @@ -1225,6 +1248,7 @@ func Test_server_StreamUpdate(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1253,6 +1277,7 @@ func Test_server_StreamUpdate(t *testing.T) { } func Test_server_MultiUpdate(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vecs *payload.Object_Vectors @@ -1332,6 +1357,7 @@ func Test_server_MultiUpdate(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1360,6 +1386,7 @@ func Test_server_MultiUpdate(t *testing.T) { } func Test_server_Upsert(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vec *payload.Object_Vector @@ -1372,8 +1399,8 @@ func Test_server_Upsert(t *testing.T) { streamConcurrency int } type want struct { - want *payload.Object_Location - err error + wantLoc *payload.Object_Location + err error } type test struct { name string @@ -1384,12 +1411,12 @@ func Test_server_Upsert(t *testing.T) { beforeFunc func(args) afterFunc func(args) } - defaultCheckFunc := func(w want, got *payload.Object_Location, err error) error { + defaultCheckFunc := func(w want, gotLoc *payload.Object_Location, err error) error { if !errors.Is(err, w.err) { return errors.Errorf("got error = %v, want %v", err, w.err) } - if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + if !reflect.DeepEqual(gotLoc, w.wantLoc) { + return errors.Errorf("got = %v, want %v", gotLoc, w.wantLoc) } return nil } @@ -1439,6 +1466,7 @@ func Test_server_Upsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1457,8 +1485,8 @@ func Test_server_Upsert(t *testing.T) { streamConcurrency: test.fields.streamConcurrency, } - got, err := s.Upsert(test.args.ctx, test.args.vec) - if err := test.checkFunc(test.want, got, err); err != nil { + gotLoc, err := s.Upsert(test.args.ctx, test.args.vec) + if err := test.checkFunc(test.want, gotLoc, err); err != nil { tt.Errorf("error = %v", err) } @@ -1467,6 +1495,7 @@ func Test_server_Upsert(t *testing.T) { } func Test_server_StreamUpsert(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamUpsertServer } @@ -1539,6 +1568,7 @@ func Test_server_StreamUpsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1567,6 +1597,7 @@ func Test_server_StreamUpsert(t *testing.T) { } func Test_server_MultiUpsert(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vecs *payload.Object_Vectors @@ -1646,6 +1677,7 @@ func Test_server_MultiUpsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1674,6 +1706,7 @@ func Test_server_MultiUpsert(t *testing.T) { } func Test_server_Remove(t *testing.T) { + t.Parallel() type args struct { ctx context.Context id *payload.Object_ID @@ -1753,6 +1786,7 @@ func Test_server_Remove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1781,6 +1815,7 @@ func Test_server_Remove(t *testing.T) { } func Test_server_StreamRemove(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamRemoveServer } @@ -1853,6 +1888,7 @@ func Test_server_StreamRemove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1881,6 +1917,7 @@ func Test_server_StreamRemove(t *testing.T) { } func Test_server_MultiRemove(t *testing.T) { + t.Parallel() type args struct { ctx context.Context ids *payload.Object_IDs @@ -1960,6 +1997,7 @@ func Test_server_MultiRemove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1988,6 +2026,7 @@ func Test_server_MultiRemove(t *testing.T) { } func Test_server_GetObject(t *testing.T) { + t.Parallel() type args struct { ctx context.Context id *payload.Object_ID @@ -2067,6 +2106,7 @@ func Test_server_GetObject(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -2095,6 +2135,7 @@ func Test_server_GetObject(t *testing.T) { } func Test_server_StreamGetObject(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamGetObjectServer } @@ -2167,6 +2208,7 @@ func Test_server_StreamGetObject(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/meta/handler/grpc/option_test.go b/pkg/gateway/meta/handler/grpc/option_test.go index d94646f79b..d00b4fac0a 100644 --- a/pkg/gateway/meta/handler/grpc/option_test.go +++ b/pkg/gateway/meta/handler/grpc/option_test.go @@ -27,6 +27,7 @@ import ( ) func TestWithClient(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -103,6 +104,7 @@ func TestWithClient(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -141,6 +143,7 @@ func TestWithClient(t *testing.T) { } func TestWithMeta(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -217,6 +220,7 @@ func TestWithMeta(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -255,6 +259,7 @@ func TestWithMeta(t *testing.T) { } func TestWithErrGroup(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -331,6 +336,7 @@ func TestWithErrGroup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -369,6 +375,7 @@ func TestWithErrGroup(t *testing.T) { } func TestWithStreamConcurrency(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -445,6 +452,7 @@ func TestWithStreamConcurrency(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/meta/handler/rest/handler_test.go b/pkg/gateway/meta/handler/rest/handler_test.go index ae0f640120..b8f8353265 100644 --- a/pkg/gateway/meta/handler/rest/handler_test.go +++ b/pkg/gateway/meta/handler/rest/handler_test.go @@ -28,6 +28,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -78,6 +79,7 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -99,6 +101,7 @@ func TestNew(t *testing.T) { } func Test_handler_Index(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -166,6 +169,7 @@ func Test_handler_Index(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -190,6 +194,7 @@ func Test_handler_Index(t *testing.T) { } func Test_handler_Search(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -257,6 +262,7 @@ func Test_handler_Search(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -281,6 +287,7 @@ func Test_handler_Search(t *testing.T) { } func Test_handler_SearchByID(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -348,6 +355,7 @@ func Test_handler_SearchByID(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -372,6 +380,7 @@ func Test_handler_SearchByID(t *testing.T) { } func Test_handler_Insert(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -439,6 +448,7 @@ func Test_handler_Insert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -463,6 +473,7 @@ func Test_handler_Insert(t *testing.T) { } func Test_handler_MultiInsert(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -530,6 +541,7 @@ func Test_handler_MultiInsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -554,6 +566,7 @@ func Test_handler_MultiInsert(t *testing.T) { } func Test_handler_Update(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -621,6 +634,7 @@ func Test_handler_Update(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -645,6 +659,7 @@ func Test_handler_Update(t *testing.T) { } func Test_handler_MultiUpdate(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -712,6 +727,7 @@ func Test_handler_MultiUpdate(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -736,6 +752,7 @@ func Test_handler_MultiUpdate(t *testing.T) { } func Test_handler_Remove(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -803,6 +820,7 @@ func Test_handler_Remove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -827,6 +845,7 @@ func Test_handler_Remove(t *testing.T) { } func Test_handler_MultiRemove(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -894,6 +913,7 @@ func Test_handler_MultiRemove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -918,6 +938,7 @@ func Test_handler_MultiRemove(t *testing.T) { } func Test_handler_GetObject(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -985,6 +1006,7 @@ func Test_handler_GetObject(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1009,6 +1031,7 @@ func Test_handler_GetObject(t *testing.T) { } func Test_handler_Exists(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -1076,6 +1099,7 @@ func Test_handler_Exists(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/meta/handler/rest/option_test.go b/pkg/gateway/meta/handler/rest/option_test.go index d45859d8db..851f4f03ce 100644 --- a/pkg/gateway/meta/handler/rest/option_test.go +++ b/pkg/gateway/meta/handler/rest/option_test.go @@ -25,6 +25,7 @@ import ( ) func TestWithVald(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -101,6 +102,7 @@ func TestWithVald(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/meta/router/option_test.go b/pkg/gateway/meta/router/option_test.go index 486b7d0e43..b14798bc4b 100644 --- a/pkg/gateway/meta/router/option_test.go +++ b/pkg/gateway/meta/router/option_test.go @@ -25,6 +25,7 @@ import ( ) func TestWithHandler(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -101,6 +102,7 @@ func TestWithHandler(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -139,6 +141,7 @@ func TestWithHandler(t *testing.T) { } func TestWithTimeout(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -215,6 +218,7 @@ func TestWithTimeout(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/meta/router/router_test.go b/pkg/gateway/meta/router/router_test.go index 043c1775f1..ec7ce94494 100644 --- a/pkg/gateway/meta/router/router_test.go +++ b/pkg/gateway/meta/router/router_test.go @@ -27,6 +27,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -77,6 +78,7 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/meta/service/meta_test.go b/pkg/gateway/meta/service/meta_test.go index f666f1c9f9..053e803c82 100644 --- a/pkg/gateway/meta/service/meta_test.go +++ b/pkg/gateway/meta/service/meta_test.go @@ -29,6 +29,7 @@ import ( ) func TestNewMeta(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -83,6 +84,7 @@ func TestNewMeta(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -104,6 +106,7 @@ func TestNewMeta(t *testing.T) { } func Test_meta_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -183,6 +186,7 @@ func Test_meta_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -212,6 +216,7 @@ func Test_meta_Start(t *testing.T) { } func Test_meta_Exists(t *testing.T) { + t.Parallel() type args struct { ctx context.Context meta string @@ -294,6 +299,7 @@ func Test_meta_Exists(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -323,6 +329,7 @@ func Test_meta_Exists(t *testing.T) { } func Test_meta_GetMeta(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uuid string @@ -405,6 +412,7 @@ func Test_meta_GetMeta(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -434,6 +442,7 @@ func Test_meta_GetMeta(t *testing.T) { } func Test_meta_GetMetas(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uuids []string @@ -516,6 +525,7 @@ func Test_meta_GetMetas(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -545,6 +555,7 @@ func Test_meta_GetMetas(t *testing.T) { } func Test_meta_GetUUID(t *testing.T) { + t.Parallel() type args struct { ctx context.Context meta string @@ -627,6 +638,7 @@ func Test_meta_GetUUID(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -656,6 +668,7 @@ func Test_meta_GetUUID(t *testing.T) { } func Test_meta_GetUUIDs(t *testing.T) { + t.Parallel() type args struct { ctx context.Context metas []string @@ -738,6 +751,7 @@ func Test_meta_GetUUIDs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -767,6 +781,7 @@ func Test_meta_GetUUIDs(t *testing.T) { } func Test_meta_SetUUIDandMeta(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uuid string @@ -848,6 +863,7 @@ func Test_meta_SetUUIDandMeta(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -877,6 +893,7 @@ func Test_meta_SetUUIDandMeta(t *testing.T) { } func Test_meta_SetUUIDandMetas(t *testing.T) { + t.Parallel() type args struct { ctx context.Context kvs map[string]string @@ -955,6 +972,7 @@ func Test_meta_SetUUIDandMetas(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -984,6 +1002,7 @@ func Test_meta_SetUUIDandMetas(t *testing.T) { } func Test_meta_DeleteMeta(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uuid string @@ -1066,6 +1085,7 @@ func Test_meta_DeleteMeta(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1095,6 +1115,7 @@ func Test_meta_DeleteMeta(t *testing.T) { } func Test_meta_DeleteMetas(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uuids []string @@ -1177,6 +1198,7 @@ func Test_meta_DeleteMetas(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1206,6 +1228,7 @@ func Test_meta_DeleteMetas(t *testing.T) { } func Test_meta_DeleteUUID(t *testing.T) { + t.Parallel() type args struct { ctx context.Context meta string @@ -1288,6 +1311,7 @@ func Test_meta_DeleteUUID(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1317,6 +1341,7 @@ func Test_meta_DeleteUUID(t *testing.T) { } func Test_meta_DeleteUUIDs(t *testing.T) { + t.Parallel() type args struct { ctx context.Context metas []string @@ -1399,6 +1424,7 @@ func Test_meta_DeleteUUIDs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/meta/service/option_test.go b/pkg/gateway/meta/service/option_test.go index 9c022ce498..743f9e028f 100644 --- a/pkg/gateway/meta/service/option_test.go +++ b/pkg/gateway/meta/service/option_test.go @@ -26,6 +26,7 @@ import ( ) func TestWithMetaAddr(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -102,6 +103,7 @@ func TestWithMetaAddr(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -140,6 +142,7 @@ func TestWithMetaAddr(t *testing.T) { } func TestWithMetaHostPort(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -219,6 +222,7 @@ func TestWithMetaHostPort(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -257,6 +261,7 @@ func TestWithMetaHostPort(t *testing.T) { } func TestWithMetaClient(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -333,6 +338,7 @@ func TestWithMetaClient(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -371,6 +377,7 @@ func TestWithMetaClient(t *testing.T) { } func TestWithMetaCacheEnabled(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -447,6 +454,7 @@ func TestWithMetaCacheEnabled(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -485,6 +493,7 @@ func TestWithMetaCacheEnabled(t *testing.T) { } func TestWithMetaCache(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -561,6 +570,7 @@ func TestWithMetaCache(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -599,6 +609,7 @@ func TestWithMetaCache(t *testing.T) { } func TestWithMetaCacheExpireDuration(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -675,6 +686,7 @@ func TestWithMetaCacheExpireDuration(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -713,6 +725,7 @@ func TestWithMetaCacheExpireDuration(t *testing.T) { } func TestWithMetaCacheExpiredCheckDuration(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -789,6 +802,7 @@ func TestWithMetaCacheExpiredCheckDuration(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/meta/usecase/vald_test.go b/pkg/gateway/meta/usecase/vald_test.go index 953ae8800b..20c300b5e1 100644 --- a/pkg/gateway/meta/usecase/vald_test.go +++ b/pkg/gateway/meta/usecase/vald_test.go @@ -32,6 +32,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { cfg *config.Data } @@ -86,6 +87,7 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -107,6 +109,7 @@ func TestNew(t *testing.T) { } func Test_run_PreStart(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -179,6 +182,7 @@ func Test_run_PreStart(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -207,6 +211,7 @@ func Test_run_PreStart(t *testing.T) { } func Test_run_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -283,6 +288,7 @@ func Test_run_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -311,6 +317,7 @@ func Test_run_Start(t *testing.T) { } func Test_run_PreStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -383,6 +390,7 @@ func Test_run_PreStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -411,6 +419,7 @@ func Test_run_PreStop(t *testing.T) { } func Test_run_Stop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -483,6 +492,7 @@ func Test_run_Stop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -511,6 +521,7 @@ func Test_run_Stop(t *testing.T) { } func Test_run_PostStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -583,6 +594,7 @@ func Test_run_PostStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/tool/location/location_test.go b/pkg/gateway/tool/location/location_test.go index 949e74cf91..2c96b48296 100644 --- a/pkg/gateway/tool/location/location_test.go +++ b/pkg/gateway/tool/location/location_test.go @@ -25,6 +25,7 @@ import ( ) func TestReStructure(t *testing.T) { + t.Parallel() type args struct { uuids []string locs *payload.Object_Locations @@ -78,6 +79,7 @@ func TestReStructure(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/vald/config/config_test.go b/pkg/gateway/vald/config/config_test.go index 6f1e2076f9..9a2a62be78 100644 --- a/pkg/gateway/vald/config/config_test.go +++ b/pkg/gateway/vald/config/config_test.go @@ -26,6 +26,7 @@ import ( ) func TestNewConfig(t *testing.T) { + t.Parallel() type args struct { path string } @@ -80,6 +81,7 @@ func TestNewConfig(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/vald/handler/grpc/checklist_test.go b/pkg/gateway/vald/handler/grpc/checklist_test.go index 147c124ce2..6cf7441259 100644 --- a/pkg/gateway/vald/handler/grpc/checklist_test.go +++ b/pkg/gateway/vald/handler/grpc/checklist_test.go @@ -28,6 +28,7 @@ import ( ) func Test_checkList_Exists(t *testing.T) { + t.Parallel() type args struct { key string } @@ -97,6 +98,7 @@ func Test_checkList_Exists(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -124,6 +126,7 @@ func Test_checkList_Exists(t *testing.T) { } func Test_checkList_Check(t *testing.T) { + t.Parallel() type args struct { key string } @@ -189,6 +192,7 @@ func Test_checkList_Check(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -215,6 +219,7 @@ func Test_checkList_Check(t *testing.T) { } func Test_entryCheckList_tryStore(t *testing.T) { + t.Parallel() type args struct { i *struct{} } @@ -275,6 +280,7 @@ func Test_entryCheckList_tryStore(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -299,6 +305,7 @@ func Test_entryCheckList_tryStore(t *testing.T) { } func Test_entryCheckList_unexpungeLocked(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -349,6 +356,7 @@ func Test_entryCheckList_unexpungeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() @@ -373,6 +381,7 @@ func Test_entryCheckList_unexpungeLocked(t *testing.T) { } func Test_checkList_missLocked(t *testing.T) { + t.Parallel() type fields struct { mu sync.Mutex read atomic.Value @@ -428,6 +437,7 @@ func Test_checkList_missLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() @@ -454,6 +464,7 @@ func Test_checkList_missLocked(t *testing.T) { } func Test_checkList_dirtyLocked(t *testing.T) { + t.Parallel() type fields struct { mu sync.Mutex read atomic.Value @@ -509,6 +520,7 @@ func Test_checkList_dirtyLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() @@ -535,6 +547,7 @@ func Test_checkList_dirtyLocked(t *testing.T) { } func Test_entryCheckList_tryExpungeLocked(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -585,6 +598,7 @@ func Test_entryCheckList_tryExpungeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() diff --git a/pkg/gateway/vald/handler/grpc/handler_test.go b/pkg/gateway/vald/handler/grpc/handler_test.go index 82dd4df650..0c732f9ea2 100644 --- a/pkg/gateway/vald/handler/grpc/handler_test.go +++ b/pkg/gateway/vald/handler/grpc/handler_test.go @@ -33,6 +33,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -83,6 +84,7 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -104,6 +106,7 @@ func TestNew(t *testing.T) { } func Test_server_Exists(t *testing.T) { + t.Parallel() type args struct { ctx context.Context meta *payload.Object_ID @@ -192,6 +195,7 @@ func Test_server_Exists(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -223,6 +227,7 @@ func Test_server_Exists(t *testing.T) { } func Test_server_Search(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Search_Request @@ -311,6 +316,7 @@ func Test_server_Search(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -342,6 +348,7 @@ func Test_server_Search(t *testing.T) { } func Test_server_SearchByID(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Search_IDRequest @@ -430,6 +437,7 @@ func Test_server_SearchByID(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -461,6 +469,7 @@ func Test_server_SearchByID(t *testing.T) { } func Test_server_search(t *testing.T) { + t.Parallel() type args struct { ctx context.Context cfg *payload.Search_Config @@ -552,6 +561,7 @@ func Test_server_search(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -583,6 +593,7 @@ func Test_server_search(t *testing.T) { } func Test_server_StreamSearch(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamSearchServer } @@ -664,6 +675,7 @@ func Test_server_StreamSearch(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -695,6 +707,7 @@ func Test_server_StreamSearch(t *testing.T) { } func Test_server_StreamSearchByID(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamSearchByIDServer } @@ -776,6 +789,7 @@ func Test_server_StreamSearchByID(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -807,6 +821,7 @@ func Test_server_StreamSearchByID(t *testing.T) { } func Test_server_Insert(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vec *payload.Object_Vector @@ -895,6 +910,7 @@ func Test_server_Insert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -926,6 +942,7 @@ func Test_server_Insert(t *testing.T) { } func Test_server_StreamInsert(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamInsertServer } @@ -1007,6 +1024,7 @@ func Test_server_StreamInsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1038,6 +1056,7 @@ func Test_server_StreamInsert(t *testing.T) { } func Test_server_MultiInsert(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vecs *payload.Object_Vectors @@ -1126,6 +1145,7 @@ func Test_server_MultiInsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1157,6 +1177,7 @@ func Test_server_MultiInsert(t *testing.T) { } func Test_server_Update(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vec *payload.Object_Vector @@ -1245,6 +1266,7 @@ func Test_server_Update(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1276,6 +1298,7 @@ func Test_server_Update(t *testing.T) { } func Test_server_StreamUpdate(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamUpdateServer } @@ -1357,6 +1380,7 @@ func Test_server_StreamUpdate(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1388,6 +1412,7 @@ func Test_server_StreamUpdate(t *testing.T) { } func Test_server_MultiUpdate(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vecs *payload.Object_Vectors @@ -1476,6 +1501,7 @@ func Test_server_MultiUpdate(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1507,6 +1533,7 @@ func Test_server_MultiUpdate(t *testing.T) { } func Test_server_Upsert(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vec *payload.Object_Vector @@ -1595,6 +1622,7 @@ func Test_server_Upsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1626,6 +1654,7 @@ func Test_server_Upsert(t *testing.T) { } func Test_server_StreamUpsert(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamUpsertServer } @@ -1707,6 +1736,7 @@ func Test_server_StreamUpsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1738,6 +1768,7 @@ func Test_server_StreamUpsert(t *testing.T) { } func Test_server_MultiUpsert(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vecs *payload.Object_Vectors @@ -1826,6 +1857,7 @@ func Test_server_MultiUpsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1857,6 +1889,7 @@ func Test_server_MultiUpsert(t *testing.T) { } func Test_server_Remove(t *testing.T) { + t.Parallel() type args struct { ctx context.Context id *payload.Object_ID @@ -1945,6 +1978,7 @@ func Test_server_Remove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1976,6 +2010,7 @@ func Test_server_Remove(t *testing.T) { } func Test_server_StreamRemove(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamRemoveServer } @@ -2057,6 +2092,7 @@ func Test_server_StreamRemove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -2088,6 +2124,7 @@ func Test_server_StreamRemove(t *testing.T) { } func Test_server_MultiRemove(t *testing.T) { + t.Parallel() type args struct { ctx context.Context ids *payload.Object_IDs @@ -2176,6 +2213,7 @@ func Test_server_MultiRemove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -2207,6 +2245,7 @@ func Test_server_MultiRemove(t *testing.T) { } func Test_server_GetObject(t *testing.T) { + t.Parallel() type args struct { ctx context.Context id *payload.Object_ID @@ -2295,6 +2334,7 @@ func Test_server_GetObject(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -2326,6 +2366,7 @@ func Test_server_GetObject(t *testing.T) { } func Test_server_StreamGetObject(t *testing.T) { + t.Parallel() type args struct { stream vald.Vald_StreamGetObjectServer } @@ -2407,6 +2448,7 @@ func Test_server_StreamGetObject(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/vald/handler/grpc/option_test.go b/pkg/gateway/vald/handler/grpc/option_test.go index b453352dc1..19d0bfb87c 100644 --- a/pkg/gateway/vald/handler/grpc/option_test.go +++ b/pkg/gateway/vald/handler/grpc/option_test.go @@ -26,6 +26,7 @@ import ( ) func TestWithGateway(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -102,6 +103,7 @@ func TestWithGateway(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -140,6 +142,7 @@ func TestWithGateway(t *testing.T) { } func TestWithMeta(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -216,6 +219,7 @@ func TestWithMeta(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -254,6 +258,7 @@ func TestWithMeta(t *testing.T) { } func TestWithBackup(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -330,6 +335,7 @@ func TestWithBackup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -368,6 +374,7 @@ func TestWithBackup(t *testing.T) { } func TestWithFilters(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -444,6 +451,7 @@ func TestWithFilters(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -482,6 +490,7 @@ func TestWithFilters(t *testing.T) { } func TestWithErrGroup(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -558,6 +567,7 @@ func TestWithErrGroup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -596,6 +606,7 @@ func TestWithErrGroup(t *testing.T) { } func TestWithTimeout(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -672,6 +683,7 @@ func TestWithTimeout(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -710,6 +722,7 @@ func TestWithTimeout(t *testing.T) { } func TestWithReplicationCount(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -786,6 +799,7 @@ func TestWithReplicationCount(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -824,6 +838,7 @@ func TestWithReplicationCount(t *testing.T) { } func TestWithStreamConcurrency(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -900,6 +915,7 @@ func TestWithStreamConcurrency(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/vald/handler/rest/handler_test.go b/pkg/gateway/vald/handler/rest/handler_test.go index ae0f640120..b8f8353265 100644 --- a/pkg/gateway/vald/handler/rest/handler_test.go +++ b/pkg/gateway/vald/handler/rest/handler_test.go @@ -28,6 +28,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -78,6 +79,7 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -99,6 +101,7 @@ func TestNew(t *testing.T) { } func Test_handler_Index(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -166,6 +169,7 @@ func Test_handler_Index(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -190,6 +194,7 @@ func Test_handler_Index(t *testing.T) { } func Test_handler_Search(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -257,6 +262,7 @@ func Test_handler_Search(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -281,6 +287,7 @@ func Test_handler_Search(t *testing.T) { } func Test_handler_SearchByID(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -348,6 +355,7 @@ func Test_handler_SearchByID(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -372,6 +380,7 @@ func Test_handler_SearchByID(t *testing.T) { } func Test_handler_Insert(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -439,6 +448,7 @@ func Test_handler_Insert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -463,6 +473,7 @@ func Test_handler_Insert(t *testing.T) { } func Test_handler_MultiInsert(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -530,6 +541,7 @@ func Test_handler_MultiInsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -554,6 +566,7 @@ func Test_handler_MultiInsert(t *testing.T) { } func Test_handler_Update(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -621,6 +634,7 @@ func Test_handler_Update(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -645,6 +659,7 @@ func Test_handler_Update(t *testing.T) { } func Test_handler_MultiUpdate(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -712,6 +727,7 @@ func Test_handler_MultiUpdate(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -736,6 +752,7 @@ func Test_handler_MultiUpdate(t *testing.T) { } func Test_handler_Remove(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -803,6 +820,7 @@ func Test_handler_Remove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -827,6 +845,7 @@ func Test_handler_Remove(t *testing.T) { } func Test_handler_MultiRemove(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -894,6 +913,7 @@ func Test_handler_MultiRemove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -918,6 +938,7 @@ func Test_handler_MultiRemove(t *testing.T) { } func Test_handler_GetObject(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -985,6 +1006,7 @@ func Test_handler_GetObject(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1009,6 +1031,7 @@ func Test_handler_GetObject(t *testing.T) { } func Test_handler_Exists(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -1076,6 +1099,7 @@ func Test_handler_Exists(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/vald/handler/rest/option_test.go b/pkg/gateway/vald/handler/rest/option_test.go index d45859d8db..851f4f03ce 100644 --- a/pkg/gateway/vald/handler/rest/option_test.go +++ b/pkg/gateway/vald/handler/rest/option_test.go @@ -25,6 +25,7 @@ import ( ) func TestWithVald(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -101,6 +102,7 @@ func TestWithVald(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/vald/router/option_test.go b/pkg/gateway/vald/router/option_test.go index 51d8860afb..209ea85f10 100644 --- a/pkg/gateway/vald/router/option_test.go +++ b/pkg/gateway/vald/router/option_test.go @@ -25,6 +25,7 @@ import ( ) func TestWithHandler(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -101,6 +102,7 @@ func TestWithHandler(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -139,6 +141,7 @@ func TestWithHandler(t *testing.T) { } func TestWithTimeout(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -215,6 +218,7 @@ func TestWithTimeout(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/vald/router/router_test.go b/pkg/gateway/vald/router/router_test.go index 043c1775f1..ec7ce94494 100644 --- a/pkg/gateway/vald/router/router_test.go +++ b/pkg/gateway/vald/router/router_test.go @@ -27,6 +27,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -77,6 +78,7 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/vald/service/backup_option_test.go b/pkg/gateway/vald/service/backup_option_test.go index 27be1d2b09..95c449e4a7 100644 --- a/pkg/gateway/vald/service/backup_option_test.go +++ b/pkg/gateway/vald/service/backup_option_test.go @@ -25,6 +25,7 @@ import ( ) func TestWithBackupAddr(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -101,6 +102,7 @@ func TestWithBackupAddr(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -139,6 +141,7 @@ func TestWithBackupAddr(t *testing.T) { } func TestWithBackupClient(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -215,6 +218,7 @@ func TestWithBackupClient(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/vald/service/backup_test.go b/pkg/gateway/vald/service/backup_test.go index 8021ffc8b1..8fa2899838 100644 --- a/pkg/gateway/vald/service/backup_test.go +++ b/pkg/gateway/vald/service/backup_test.go @@ -28,6 +28,7 @@ import ( ) func TestNewBackup(t *testing.T) { + t.Parallel() type args struct { opts []BackupOption } @@ -82,6 +83,7 @@ func TestNewBackup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -103,6 +105,7 @@ func TestNewBackup(t *testing.T) { } func Test_backup_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -170,6 +173,7 @@ func Test_backup_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -195,6 +199,7 @@ func Test_backup_Start(t *testing.T) { } func Test_backup_GetObject(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uuid string @@ -265,6 +270,7 @@ func Test_backup_GetObject(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -290,6 +296,7 @@ func Test_backup_GetObject(t *testing.T) { } func Test_backup_GetLocation(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uuid string @@ -360,6 +367,7 @@ func Test_backup_GetLocation(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -385,6 +393,7 @@ func Test_backup_GetLocation(t *testing.T) { } func Test_backup_Register(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vec *payload.Backup_MetaVector @@ -451,6 +460,7 @@ func Test_backup_Register(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -476,6 +486,7 @@ func Test_backup_Register(t *testing.T) { } func Test_backup_RegisterMultiple(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vecs *payload.Backup_MetaVectors @@ -542,6 +553,7 @@ func Test_backup_RegisterMultiple(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -567,6 +579,7 @@ func Test_backup_RegisterMultiple(t *testing.T) { } func Test_backup_Remove(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uuid string @@ -633,6 +646,7 @@ func Test_backup_Remove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -658,6 +672,7 @@ func Test_backup_Remove(t *testing.T) { } func Test_backup_RemoveMultiple(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uuids []string @@ -724,6 +739,7 @@ func Test_backup_RemoveMultiple(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/vald/service/filter_option_test.go b/pkg/gateway/vald/service/filter_option_test.go index 7d941b6e8c..4b68c43eb2 100644 --- a/pkg/gateway/vald/service/filter_option_test.go +++ b/pkg/gateway/vald/service/filter_option_test.go @@ -25,6 +25,7 @@ import ( ) func TestWithFilterClient(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -101,6 +102,7 @@ func TestWithFilterClient(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/vald/service/filter_test.go b/pkg/gateway/vald/service/filter_test.go index defabd62e3..8ff5c8b521 100644 --- a/pkg/gateway/vald/service/filter_test.go +++ b/pkg/gateway/vald/service/filter_test.go @@ -28,6 +28,7 @@ import ( ) func TestNewFilter(t *testing.T) { + t.Parallel() type args struct { opts []FilterOption } @@ -82,6 +83,7 @@ func TestNewFilter(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -103,6 +105,7 @@ func TestNewFilter(t *testing.T) { } func Test_filter_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -167,6 +170,7 @@ func Test_filter_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -191,6 +195,7 @@ func Test_filter_Start(t *testing.T) { } func Test_filter_FilterSearch(t *testing.T) { + t.Parallel() type args struct { ctx context.Context res *payload.Search_Response @@ -258,6 +263,7 @@ func Test_filter_FilterSearch(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/vald/service/gateway_option_test.go b/pkg/gateway/vald/service/gateway_option_test.go index 6ac318982a..6adb0e6a1b 100644 --- a/pkg/gateway/vald/service/gateway_option_test.go +++ b/pkg/gateway/vald/service/gateway_option_test.go @@ -26,6 +26,7 @@ import ( ) func TestWithDiscoverer(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -102,6 +103,7 @@ func TestWithDiscoverer(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -140,6 +142,7 @@ func TestWithDiscoverer(t *testing.T) { } func TestWithErrGroup(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -216,6 +219,7 @@ func TestWithErrGroup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/vald/service/gateway_test.go b/pkg/gateway/vald/service/gateway_test.go index 730e991bf2..6f425cf81b 100644 --- a/pkg/gateway/vald/service/gateway_test.go +++ b/pkg/gateway/vald/service/gateway_test.go @@ -31,6 +31,7 @@ import ( ) func TestNewGateway(t *testing.T) { + t.Parallel() type args struct { opts []GWOption } @@ -85,6 +86,7 @@ func TestNewGateway(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -106,6 +108,7 @@ func TestNewGateway(t *testing.T) { } func Test_gateway_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -173,6 +176,7 @@ func Test_gateway_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -198,6 +202,7 @@ func Test_gateway_Start(t *testing.T) { } func Test_gateway_BroadCast(t *testing.T) { + t.Parallel() type args struct { ctx context.Context f func(ctx context.Context, target string, vc vald.ValdClient, copts ...grpc.CallOption) error @@ -264,6 +269,7 @@ func Test_gateway_BroadCast(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -289,6 +295,7 @@ func Test_gateway_BroadCast(t *testing.T) { } func Test_gateway_Do(t *testing.T) { + t.Parallel() type args struct { ctx context.Context f func(ctx context.Context, target string, vc vald.ValdClient, copts ...grpc.CallOption) error @@ -355,6 +362,7 @@ func Test_gateway_Do(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -380,6 +388,7 @@ func Test_gateway_Do(t *testing.T) { } func Test_gateway_DoMulti(t *testing.T) { + t.Parallel() type args struct { ctx context.Context num int @@ -449,6 +458,7 @@ func Test_gateway_DoMulti(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -474,6 +484,7 @@ func Test_gateway_DoMulti(t *testing.T) { } func Test_gateway_GetAgentCount(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -537,6 +548,7 @@ func Test_gateway_GetAgentCount(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/vald/service/meta_option_test.go b/pkg/gateway/vald/service/meta_option_test.go index 9c022ce498..743f9e028f 100644 --- a/pkg/gateway/vald/service/meta_option_test.go +++ b/pkg/gateway/vald/service/meta_option_test.go @@ -26,6 +26,7 @@ import ( ) func TestWithMetaAddr(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -102,6 +103,7 @@ func TestWithMetaAddr(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -140,6 +142,7 @@ func TestWithMetaAddr(t *testing.T) { } func TestWithMetaHostPort(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -219,6 +222,7 @@ func TestWithMetaHostPort(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -257,6 +261,7 @@ func TestWithMetaHostPort(t *testing.T) { } func TestWithMetaClient(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -333,6 +338,7 @@ func TestWithMetaClient(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -371,6 +377,7 @@ func TestWithMetaClient(t *testing.T) { } func TestWithMetaCacheEnabled(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -447,6 +454,7 @@ func TestWithMetaCacheEnabled(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -485,6 +493,7 @@ func TestWithMetaCacheEnabled(t *testing.T) { } func TestWithMetaCache(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -561,6 +570,7 @@ func TestWithMetaCache(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -599,6 +609,7 @@ func TestWithMetaCache(t *testing.T) { } func TestWithMetaCacheExpireDuration(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -675,6 +686,7 @@ func TestWithMetaCacheExpireDuration(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -713,6 +725,7 @@ func TestWithMetaCacheExpireDuration(t *testing.T) { } func TestWithMetaCacheExpiredCheckDuration(t *testing.T) { + t.Parallel() // Change interface type to the type of object you are testing type T = interface{} type args struct { @@ -789,6 +802,7 @@ func TestWithMetaCacheExpiredCheckDuration(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/vald/service/meta_test.go b/pkg/gateway/vald/service/meta_test.go index 2f6c63542e..e02bc6bfd4 100644 --- a/pkg/gateway/vald/service/meta_test.go +++ b/pkg/gateway/vald/service/meta_test.go @@ -29,6 +29,7 @@ import ( ) func TestNewMeta(t *testing.T) { + t.Parallel() type args struct { opts []MetaOption } @@ -83,6 +84,7 @@ func TestNewMeta(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -104,6 +106,7 @@ func TestNewMeta(t *testing.T) { } func Test_meta_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -183,6 +186,7 @@ func Test_meta_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -212,6 +216,7 @@ func Test_meta_Start(t *testing.T) { } func Test_meta_Exists(t *testing.T) { + t.Parallel() type args struct { ctx context.Context meta string @@ -294,6 +299,7 @@ func Test_meta_Exists(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -323,6 +329,7 @@ func Test_meta_Exists(t *testing.T) { } func Test_meta_GetMeta(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uuid string @@ -405,6 +412,7 @@ func Test_meta_GetMeta(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -434,6 +442,7 @@ func Test_meta_GetMeta(t *testing.T) { } func Test_meta_GetMetas(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uuids []string @@ -516,6 +525,7 @@ func Test_meta_GetMetas(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -545,6 +555,7 @@ func Test_meta_GetMetas(t *testing.T) { } func Test_meta_GetUUID(t *testing.T) { + t.Parallel() type args struct { ctx context.Context meta string @@ -627,6 +638,7 @@ func Test_meta_GetUUID(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -656,6 +668,7 @@ func Test_meta_GetUUID(t *testing.T) { } func Test_meta_GetUUIDs(t *testing.T) { + t.Parallel() type args struct { ctx context.Context metas []string @@ -738,6 +751,7 @@ func Test_meta_GetUUIDs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -767,6 +781,7 @@ func Test_meta_GetUUIDs(t *testing.T) { } func Test_meta_SetUUIDandMeta(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uuid string @@ -848,6 +863,7 @@ func Test_meta_SetUUIDandMeta(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -877,6 +893,7 @@ func Test_meta_SetUUIDandMeta(t *testing.T) { } func Test_meta_SetUUIDandMetas(t *testing.T) { + t.Parallel() type args struct { ctx context.Context kvs map[string]string @@ -955,6 +972,7 @@ func Test_meta_SetUUIDandMetas(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -984,6 +1002,7 @@ func Test_meta_SetUUIDandMetas(t *testing.T) { } func Test_meta_DeleteMeta(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uuid string @@ -1066,6 +1085,7 @@ func Test_meta_DeleteMeta(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1095,6 +1115,7 @@ func Test_meta_DeleteMeta(t *testing.T) { } func Test_meta_DeleteMetas(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uuids []string @@ -1177,6 +1198,7 @@ func Test_meta_DeleteMetas(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1206,6 +1228,7 @@ func Test_meta_DeleteMetas(t *testing.T) { } func Test_meta_DeleteUUID(t *testing.T) { + t.Parallel() type args struct { ctx context.Context meta string @@ -1288,6 +1311,7 @@ func Test_meta_DeleteUUID(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -1317,6 +1341,7 @@ func Test_meta_DeleteUUID(t *testing.T) { } func Test_meta_DeleteUUIDs(t *testing.T) { + t.Parallel() type args struct { ctx context.Context metas []string @@ -1399,6 +1424,7 @@ func Test_meta_DeleteUUIDs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/gateway/vald/usecase/vald_test.go b/pkg/gateway/vald/usecase/vald_test.go index abdb9b17cd..a5fead95dd 100644 --- a/pkg/gateway/vald/usecase/vald_test.go +++ b/pkg/gateway/vald/usecase/vald_test.go @@ -32,6 +32,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { cfg *config.Data } @@ -86,6 +87,7 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -107,6 +109,7 @@ func TestNew(t *testing.T) { } func Test_run_PreStart(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -188,6 +191,7 @@ func Test_run_PreStart(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -219,6 +223,7 @@ func Test_run_PreStart(t *testing.T) { } func Test_run_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -304,6 +309,7 @@ func Test_run_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -335,6 +341,7 @@ func Test_run_Start(t *testing.T) { } func Test_run_PreStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -416,6 +423,7 @@ func Test_run_PreStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -447,6 +455,7 @@ func Test_run_PreStop(t *testing.T) { } func Test_run_Stop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -528,6 +537,7 @@ func Test_run_Stop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -559,6 +569,7 @@ func Test_run_Stop(t *testing.T) { } func Test_run_PostStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -640,6 +651,7 @@ func Test_run_PostStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/pkg/manager/backup/cassandra/config/config_test.go b/pkg/manager/backup/cassandra/config/config_test.go index e8090717ea..9a2a62be78 100644 --- a/pkg/manager/backup/cassandra/config/config_test.go +++ b/pkg/manager/backup/cassandra/config/config_test.go @@ -26,6 +26,7 @@ import ( ) func TestNewConfig(t *testing.T) { + t.Parallel() type args struct { path string } @@ -80,7 +81,8 @@ func TestNewConfig(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/manager/backup/cassandra/handler/grpc/handler_test.go b/pkg/manager/backup/cassandra/handler/grpc/handler_test.go index d8d2a8a571..7310c14e55 100644 --- a/pkg/manager/backup/cassandra/handler/grpc/handler_test.go +++ b/pkg/manager/backup/cassandra/handler/grpc/handler_test.go @@ -30,6 +30,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -80,7 +81,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -101,6 +103,7 @@ func TestNew(t *testing.T) { } func Test_server_GetVector(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Backup_GetVector_Request @@ -168,7 +171,8 @@ func Test_server_GetVector(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -192,6 +196,7 @@ func Test_server_GetVector(t *testing.T) { } func Test_server_Locations(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Backup_Locations_Request @@ -259,7 +264,8 @@ func Test_server_Locations(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -283,6 +289,7 @@ func Test_server_Locations(t *testing.T) { } func Test_server_Register(t *testing.T) { + t.Parallel() type args struct { ctx context.Context meta *payload.Backup_Compressed_MetaVector @@ -350,7 +357,8 @@ func Test_server_Register(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -374,6 +382,7 @@ func Test_server_Register(t *testing.T) { } func Test_server_RegisterMulti(t *testing.T) { + t.Parallel() type args struct { ctx context.Context metas *payload.Backup_Compressed_MetaVectors @@ -441,7 +450,8 @@ func Test_server_RegisterMulti(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -465,6 +475,7 @@ func Test_server_RegisterMulti(t *testing.T) { } func Test_server_Remove(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Backup_Remove_Request @@ -532,7 +543,8 @@ func Test_server_Remove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -556,6 +568,7 @@ func Test_server_Remove(t *testing.T) { } func Test_server_RemoveMulti(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Backup_Remove_RequestMulti @@ -623,7 +636,8 @@ func Test_server_RemoveMulti(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -647,6 +661,7 @@ func Test_server_RemoveMulti(t *testing.T) { } func Test_server_RegisterIPs(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Backup_IP_Register_Request @@ -714,7 +729,8 @@ func Test_server_RegisterIPs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -738,6 +754,7 @@ func Test_server_RegisterIPs(t *testing.T) { } func Test_server_RemoveIPs(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Backup_IP_Remove_Request @@ -805,7 +822,8 @@ func Test_server_RemoveIPs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -829,6 +847,7 @@ func Test_server_RemoveIPs(t *testing.T) { } func Test_toBackupMetaVector(t *testing.T) { + t.Parallel() type args struct { meta *model.MetaVector } @@ -883,7 +902,8 @@ func Test_toBackupMetaVector(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -904,6 +924,7 @@ func Test_toBackupMetaVector(t *testing.T) { } func Test_toModelMetaVector(t *testing.T) { + t.Parallel() type args struct { obj *payload.Backup_Compressed_MetaVector } @@ -958,7 +979,8 @@ func Test_toModelMetaVector(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/manager/backup/cassandra/handler/grpc/option_test.go b/pkg/manager/backup/cassandra/handler/grpc/option_test.go index f57cfea3f4..0c862a2e4d 100644 --- a/pkg/manager/backup/cassandra/handler/grpc/option_test.go +++ b/pkg/manager/backup/cassandra/handler/grpc/option_test.go @@ -25,6 +25,8 @@ import ( ) func TestWithCassandra(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { c service.Cassandra @@ -62,7 +64,7 @@ func TestWithCassandra(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -100,7 +102,8 @@ func TestWithCassandra(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -121,7 +124,7 @@ func TestWithCassandra(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -129,7 +132,7 @@ func TestWithCassandra(t *testing.T) { got := WithCassandra(test.args.c) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/manager/backup/cassandra/handler/rest/handler_test.go b/pkg/manager/backup/cassandra/handler/rest/handler_test.go index e0372b7314..4e636276cf 100644 --- a/pkg/manager/backup/cassandra/handler/rest/handler_test.go +++ b/pkg/manager/backup/cassandra/handler/rest/handler_test.go @@ -28,6 +28,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -78,7 +79,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -99,6 +101,7 @@ func TestNew(t *testing.T) { } func Test_handler_GetVector(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -166,7 +169,8 @@ func Test_handler_GetVector(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -190,6 +194,7 @@ func Test_handler_GetVector(t *testing.T) { } func Test_handler_Locations(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -257,7 +262,8 @@ func Test_handler_Locations(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -281,6 +287,7 @@ func Test_handler_Locations(t *testing.T) { } func Test_handler_Register(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -348,7 +355,8 @@ func Test_handler_Register(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -372,6 +380,7 @@ func Test_handler_Register(t *testing.T) { } func Test_handler_RegisterMulti(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -439,7 +448,8 @@ func Test_handler_RegisterMulti(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -463,6 +473,7 @@ func Test_handler_RegisterMulti(t *testing.T) { } func Test_handler_Remove(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -530,7 +541,8 @@ func Test_handler_Remove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -554,6 +566,7 @@ func Test_handler_Remove(t *testing.T) { } func Test_handler_RemoveMulti(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -621,7 +634,8 @@ func Test_handler_RemoveMulti(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -645,6 +659,7 @@ func Test_handler_RemoveMulti(t *testing.T) { } func Test_handler_RegisterIPs(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -712,7 +727,8 @@ func Test_handler_RegisterIPs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -736,6 +752,7 @@ func Test_handler_RegisterIPs(t *testing.T) { } func Test_handler_RemoveIPs(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -803,7 +820,8 @@ func Test_handler_RemoveIPs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/manager/backup/cassandra/handler/rest/option_test.go b/pkg/manager/backup/cassandra/handler/rest/option_test.go index 0a237f6557..d1c8cb3fc5 100644 --- a/pkg/manager/backup/cassandra/handler/rest/option_test.go +++ b/pkg/manager/backup/cassandra/handler/rest/option_test.go @@ -25,6 +25,8 @@ import ( ) func TestWithBackup(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { b backup.BackupServer @@ -62,7 +64,7 @@ func TestWithBackup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -100,7 +102,8 @@ func TestWithBackup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -121,7 +124,7 @@ func TestWithBackup(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -129,7 +132,7 @@ func TestWithBackup(t *testing.T) { got := WithBackup(test.args.b) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/manager/backup/cassandra/router/option_test.go b/pkg/manager/backup/cassandra/router/option_test.go index 4fc0303b8c..b83d964410 100644 --- a/pkg/manager/backup/cassandra/router/option_test.go +++ b/pkg/manager/backup/cassandra/router/option_test.go @@ -26,6 +26,8 @@ import ( ) func TestWithHandler(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { h rest.Handler @@ -63,7 +65,7 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -101,7 +103,8 @@ func TestWithHandler(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -122,7 +125,7 @@ func TestWithHandler(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -130,7 +133,7 @@ func TestWithHandler(t *testing.T) { got := WithHandler(test.args.h) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -139,6 +142,8 @@ func TestWithHandler(t *testing.T) { } func TestWithTimeout(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { timeout string @@ -176,7 +181,7 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -214,7 +219,8 @@ func TestWithTimeout(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -235,7 +241,7 @@ func TestWithTimeout(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -243,7 +249,7 @@ func TestWithTimeout(t *testing.T) { got := WithTimeout(test.args.timeout) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -252,6 +258,8 @@ func TestWithTimeout(t *testing.T) { } func TestWithErrGroup(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { eg errgroup.Group @@ -289,7 +297,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -327,7 +335,8 @@ func TestWithErrGroup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -348,7 +357,7 @@ func TestWithErrGroup(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -356,7 +365,7 @@ func TestWithErrGroup(t *testing.T) { got := WithErrGroup(test.args.eg) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/manager/backup/cassandra/router/router_test.go b/pkg/manager/backup/cassandra/router/router_test.go index 7be666ccd5..ec7ce94494 100644 --- a/pkg/manager/backup/cassandra/router/router_test.go +++ b/pkg/manager/backup/cassandra/router/router_test.go @@ -27,6 +27,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -77,7 +78,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/manager/backup/cassandra/service/cassandra_test.go b/pkg/manager/backup/cassandra/service/cassandra_test.go index 24ad10e636..6cbcfbc297 100644 --- a/pkg/manager/backup/cassandra/service/cassandra_test.go +++ b/pkg/manager/backup/cassandra/service/cassandra_test.go @@ -29,6 +29,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { cfg *config.Cassandra } @@ -83,7 +84,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -104,6 +106,7 @@ func TestNew(t *testing.T) { } func Test_client_Connect(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -167,7 +170,8 @@ func Test_client_Connect(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -192,6 +196,7 @@ func Test_client_Connect(t *testing.T) { } func Test_client_Close(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -255,7 +260,8 @@ func Test_client_Close(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -280,6 +286,7 @@ func Test_client_Close(t *testing.T) { } func Test_client_getMetaVector(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uuid string @@ -350,7 +357,8 @@ func Test_client_getMetaVector(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -375,6 +383,7 @@ func Test_client_getMetaVector(t *testing.T) { } func Test_client_GetMeta(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uuid string @@ -445,7 +454,8 @@ func Test_client_GetMeta(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -470,6 +480,7 @@ func Test_client_GetMeta(t *testing.T) { } func Test_client_GetIPs(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uuid string @@ -540,7 +551,8 @@ func Test_client_GetIPs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -565,6 +577,7 @@ func Test_client_GetIPs(t *testing.T) { } func Test_client_SetMeta(t *testing.T) { + t.Parallel() type args struct { ctx context.Context meta *model.MetaVector @@ -631,7 +644,8 @@ func Test_client_SetMeta(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -656,6 +670,7 @@ func Test_client_SetMeta(t *testing.T) { } func Test_client_SetMetas(t *testing.T) { + t.Parallel() type args struct { ctx context.Context metas []*model.MetaVector @@ -722,7 +737,8 @@ func Test_client_SetMetas(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -747,6 +763,7 @@ func Test_client_SetMetas(t *testing.T) { } func Test_client_DeleteMeta(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uuid string @@ -813,7 +830,8 @@ func Test_client_DeleteMeta(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -838,6 +856,7 @@ func Test_client_DeleteMeta(t *testing.T) { } func Test_client_DeleteMetas(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uuids []string @@ -904,7 +923,8 @@ func Test_client_DeleteMetas(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -929,6 +949,7 @@ func Test_client_DeleteMetas(t *testing.T) { } func Test_client_SetIPs(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uuid string @@ -998,7 +1019,8 @@ func Test_client_SetIPs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1023,6 +1045,7 @@ func Test_client_SetIPs(t *testing.T) { } func Test_client_RemoveIPs(t *testing.T) { + t.Parallel() type args struct { ctx context.Context ips []string @@ -1089,7 +1112,8 @@ func Test_client_RemoveIPs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/manager/backup/cassandra/usecase/backupd_test.go b/pkg/manager/backup/cassandra/usecase/backupd_test.go index 372ef2c465..5fc0ca2325 100644 --- a/pkg/manager/backup/cassandra/usecase/backupd_test.go +++ b/pkg/manager/backup/cassandra/usecase/backupd_test.go @@ -32,6 +32,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { cfg *config.Data } @@ -86,7 +87,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -107,6 +109,7 @@ func TestNew(t *testing.T) { } func Test_run_PreStart(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -179,7 +182,8 @@ func Test_run_PreStart(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -207,6 +211,7 @@ func Test_run_PreStart(t *testing.T) { } func Test_run_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -283,7 +288,8 @@ func Test_run_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -311,6 +317,7 @@ func Test_run_Start(t *testing.T) { } func Test_run_PreStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -383,7 +390,8 @@ func Test_run_PreStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -411,6 +419,7 @@ func Test_run_PreStop(t *testing.T) { } func Test_run_Stop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -483,7 +492,8 @@ func Test_run_Stop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -511,6 +521,7 @@ func Test_run_Stop(t *testing.T) { } func Test_run_PostStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -583,7 +594,8 @@ func Test_run_PostStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/manager/backup/mysql/config/config_test.go b/pkg/manager/backup/mysql/config/config_test.go index e8090717ea..9a2a62be78 100644 --- a/pkg/manager/backup/mysql/config/config_test.go +++ b/pkg/manager/backup/mysql/config/config_test.go @@ -26,6 +26,7 @@ import ( ) func TestNewConfig(t *testing.T) { + t.Parallel() type args struct { path string } @@ -80,7 +81,8 @@ func TestNewConfig(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/manager/backup/mysql/handler/grpc/handler_test.go b/pkg/manager/backup/mysql/handler/grpc/handler_test.go index 5cf82e4628..037bd2308c 100644 --- a/pkg/manager/backup/mysql/handler/grpc/handler_test.go +++ b/pkg/manager/backup/mysql/handler/grpc/handler_test.go @@ -30,6 +30,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -80,7 +81,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -101,6 +103,7 @@ func TestNew(t *testing.T) { } func Test_server_GetVector(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Backup_GetVector_Request @@ -168,7 +171,8 @@ func Test_server_GetVector(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -192,6 +196,7 @@ func Test_server_GetVector(t *testing.T) { } func Test_server_Locations(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Backup_Locations_Request @@ -259,7 +264,8 @@ func Test_server_Locations(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -283,6 +289,7 @@ func Test_server_Locations(t *testing.T) { } func Test_server_Register(t *testing.T) { + t.Parallel() type args struct { ctx context.Context meta *payload.Backup_Compressed_MetaVector @@ -350,7 +357,8 @@ func Test_server_Register(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -374,6 +382,7 @@ func Test_server_Register(t *testing.T) { } func Test_server_RegisterMulti(t *testing.T) { + t.Parallel() type args struct { ctx context.Context metas *payload.Backup_Compressed_MetaVectors @@ -441,7 +450,8 @@ func Test_server_RegisterMulti(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -465,6 +475,7 @@ func Test_server_RegisterMulti(t *testing.T) { } func Test_server_Remove(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Backup_Remove_Request @@ -532,7 +543,8 @@ func Test_server_Remove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -556,6 +568,7 @@ func Test_server_Remove(t *testing.T) { } func Test_server_RemoveMulti(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Backup_Remove_RequestMulti @@ -623,7 +636,8 @@ func Test_server_RemoveMulti(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -647,6 +661,7 @@ func Test_server_RemoveMulti(t *testing.T) { } func Test_server_RegisterIPs(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Backup_IP_Register_Request @@ -714,7 +729,8 @@ func Test_server_RegisterIPs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -738,6 +754,7 @@ func Test_server_RegisterIPs(t *testing.T) { } func Test_server_RemoveIPs(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Backup_IP_Remove_Request @@ -805,7 +822,8 @@ func Test_server_RemoveIPs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -829,6 +847,7 @@ func Test_server_RemoveIPs(t *testing.T) { } func Test_toBackupMetaVector(t *testing.T) { + t.Parallel() type args struct { meta *model.MetaVector } @@ -883,7 +902,8 @@ func Test_toBackupMetaVector(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -904,6 +924,7 @@ func Test_toBackupMetaVector(t *testing.T) { } func Test_toModelMetaVector(t *testing.T) { + t.Parallel() type args struct { obj *payload.Backup_Compressed_MetaVector } @@ -958,7 +979,8 @@ func Test_toModelMetaVector(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/manager/backup/mysql/handler/grpc/option_test.go b/pkg/manager/backup/mysql/handler/grpc/option_test.go index 35b5cadf57..d86f36062c 100644 --- a/pkg/manager/backup/mysql/handler/grpc/option_test.go +++ b/pkg/manager/backup/mysql/handler/grpc/option_test.go @@ -25,6 +25,8 @@ import ( ) func TestWithMySQL(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { m service.MySQL @@ -62,7 +64,7 @@ func TestWithMySQL(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -100,7 +102,8 @@ func TestWithMySQL(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -121,7 +124,7 @@ func TestWithMySQL(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -129,7 +132,7 @@ func TestWithMySQL(t *testing.T) { got := WithMySQL(test.args.m) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/manager/backup/mysql/handler/rest/handler_test.go b/pkg/manager/backup/mysql/handler/rest/handler_test.go index e0372b7314..4e636276cf 100644 --- a/pkg/manager/backup/mysql/handler/rest/handler_test.go +++ b/pkg/manager/backup/mysql/handler/rest/handler_test.go @@ -28,6 +28,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -78,7 +79,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -99,6 +101,7 @@ func TestNew(t *testing.T) { } func Test_handler_GetVector(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -166,7 +169,8 @@ func Test_handler_GetVector(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -190,6 +194,7 @@ func Test_handler_GetVector(t *testing.T) { } func Test_handler_Locations(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -257,7 +262,8 @@ func Test_handler_Locations(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -281,6 +287,7 @@ func Test_handler_Locations(t *testing.T) { } func Test_handler_Register(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -348,7 +355,8 @@ func Test_handler_Register(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -372,6 +380,7 @@ func Test_handler_Register(t *testing.T) { } func Test_handler_RegisterMulti(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -439,7 +448,8 @@ func Test_handler_RegisterMulti(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -463,6 +473,7 @@ func Test_handler_RegisterMulti(t *testing.T) { } func Test_handler_Remove(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -530,7 +541,8 @@ func Test_handler_Remove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -554,6 +566,7 @@ func Test_handler_Remove(t *testing.T) { } func Test_handler_RemoveMulti(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -621,7 +634,8 @@ func Test_handler_RemoveMulti(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -645,6 +659,7 @@ func Test_handler_RemoveMulti(t *testing.T) { } func Test_handler_RegisterIPs(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -712,7 +727,8 @@ func Test_handler_RegisterIPs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -736,6 +752,7 @@ func Test_handler_RegisterIPs(t *testing.T) { } func Test_handler_RemoveIPs(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -803,7 +820,8 @@ func Test_handler_RemoveIPs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/manager/backup/mysql/handler/rest/option_test.go b/pkg/manager/backup/mysql/handler/rest/option_test.go index 0a237f6557..d1c8cb3fc5 100644 --- a/pkg/manager/backup/mysql/handler/rest/option_test.go +++ b/pkg/manager/backup/mysql/handler/rest/option_test.go @@ -25,6 +25,8 @@ import ( ) func TestWithBackup(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { b backup.BackupServer @@ -62,7 +64,7 @@ func TestWithBackup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -100,7 +102,8 @@ func TestWithBackup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -121,7 +124,7 @@ func TestWithBackup(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -129,7 +132,7 @@ func TestWithBackup(t *testing.T) { got := WithBackup(test.args.b) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/manager/backup/mysql/model/model_test.go b/pkg/manager/backup/mysql/model/model_test.go index f4226b3600..596b013182 100644 --- a/pkg/manager/backup/mysql/model/model_test.go +++ b/pkg/manager/backup/mysql/model/model_test.go @@ -26,6 +26,7 @@ import ( ) func TestMetaVector_GetUUID(t *testing.T) { + t.Parallel() type fields struct { UUID string Vector []byte @@ -85,7 +86,8 @@ func TestMetaVector_GetUUID(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -112,6 +114,7 @@ func TestMetaVector_GetUUID(t *testing.T) { } func TestMetaVector_GetVector(t *testing.T) { + t.Parallel() type fields struct { UUID string Vector []byte @@ -171,7 +174,8 @@ func TestMetaVector_GetVector(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -198,6 +202,7 @@ func TestMetaVector_GetVector(t *testing.T) { } func TestMetaVector_GetMeta(t *testing.T) { + t.Parallel() type fields struct { UUID string Vector []byte @@ -257,7 +262,8 @@ func TestMetaVector_GetMeta(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -284,6 +290,7 @@ func TestMetaVector_GetMeta(t *testing.T) { } func TestMetaVector_GetIPs(t *testing.T) { + t.Parallel() type fields struct { UUID string Vector []byte @@ -343,7 +350,8 @@ func TestMetaVector_GetIPs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } diff --git a/pkg/manager/backup/mysql/router/option_test.go b/pkg/manager/backup/mysql/router/option_test.go index 158b50fb28..c51378a12a 100644 --- a/pkg/manager/backup/mysql/router/option_test.go +++ b/pkg/manager/backup/mysql/router/option_test.go @@ -26,6 +26,8 @@ import ( ) func TestWithHandler(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { h rest.Handler @@ -63,7 +65,7 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -101,7 +103,8 @@ func TestWithHandler(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -122,7 +125,7 @@ func TestWithHandler(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -130,7 +133,7 @@ func TestWithHandler(t *testing.T) { got := WithHandler(test.args.h) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -139,6 +142,8 @@ func TestWithHandler(t *testing.T) { } func TestWithTimeout(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { timeout string @@ -176,7 +181,7 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -214,7 +219,8 @@ func TestWithTimeout(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -235,7 +241,7 @@ func TestWithTimeout(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -243,7 +249,7 @@ func TestWithTimeout(t *testing.T) { got := WithTimeout(test.args.timeout) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -252,6 +258,8 @@ func TestWithTimeout(t *testing.T) { } func TestWithErrGroup(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { eg errgroup.Group @@ -289,7 +297,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -327,7 +335,8 @@ func TestWithErrGroup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -348,7 +357,7 @@ func TestWithErrGroup(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -356,7 +365,7 @@ func TestWithErrGroup(t *testing.T) { got := WithErrGroup(test.args.eg) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/manager/backup/mysql/router/router_test.go b/pkg/manager/backup/mysql/router/router_test.go index 7be666ccd5..ec7ce94494 100644 --- a/pkg/manager/backup/mysql/router/router_test.go +++ b/pkg/manager/backup/mysql/router/router_test.go @@ -27,6 +27,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -77,7 +78,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/manager/backup/mysql/service/mysql_test.go b/pkg/manager/backup/mysql/service/mysql_test.go index 4c6b8b0007..37af04016b 100644 --- a/pkg/manager/backup/mysql/service/mysql_test.go +++ b/pkg/manager/backup/mysql/service/mysql_test.go @@ -30,6 +30,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { cfg *config.MySQL } @@ -84,7 +85,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -105,6 +107,7 @@ func TestNew(t *testing.T) { } func Test_client_Connect(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -168,7 +171,8 @@ func Test_client_Connect(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -193,6 +197,7 @@ func Test_client_Connect(t *testing.T) { } func Test_client_Close(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -256,7 +261,8 @@ func Test_client_Close(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -281,6 +287,7 @@ func Test_client_Close(t *testing.T) { } func Test_client_GetMeta(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uuid string @@ -351,7 +358,8 @@ func Test_client_GetMeta(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -376,6 +384,7 @@ func Test_client_GetMeta(t *testing.T) { } func Test_client_GetIPs(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uuid string @@ -446,7 +455,8 @@ func Test_client_GetIPs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -471,6 +481,7 @@ func Test_client_GetIPs(t *testing.T) { } func Test_client_SetMeta(t *testing.T) { + t.Parallel() type args struct { ctx context.Context meta *model.MetaVector @@ -537,7 +548,8 @@ func Test_client_SetMeta(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -562,6 +574,7 @@ func Test_client_SetMeta(t *testing.T) { } func Test_client_SetMetas(t *testing.T) { + t.Parallel() type args struct { ctx context.Context metas []*model.MetaVector @@ -628,7 +641,8 @@ func Test_client_SetMetas(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -653,6 +667,7 @@ func Test_client_SetMetas(t *testing.T) { } func Test_client_DeleteMeta(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uuid string @@ -719,7 +734,8 @@ func Test_client_DeleteMeta(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -744,6 +760,7 @@ func Test_client_DeleteMeta(t *testing.T) { } func Test_client_DeleteMetas(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uuids []string @@ -810,7 +827,8 @@ func Test_client_DeleteMetas(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -835,6 +853,7 @@ func Test_client_DeleteMetas(t *testing.T) { } func Test_client_SetIPs(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uuid string @@ -904,7 +923,8 @@ func Test_client_SetIPs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -929,6 +949,7 @@ func Test_client_SetIPs(t *testing.T) { } func Test_client_RemoveIPs(t *testing.T) { + t.Parallel() type args struct { ctx context.Context ips []string @@ -995,7 +1016,8 @@ func Test_client_RemoveIPs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/manager/backup/mysql/usecase/backupd_test.go b/pkg/manager/backup/mysql/usecase/backupd_test.go index 13fe7295cc..56516e710d 100644 --- a/pkg/manager/backup/mysql/usecase/backupd_test.go +++ b/pkg/manager/backup/mysql/usecase/backupd_test.go @@ -32,6 +32,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { cfg *config.Data } @@ -86,7 +87,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -107,6 +109,7 @@ func TestNew(t *testing.T) { } func Test_run_PreStart(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -179,7 +182,8 @@ func Test_run_PreStart(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -207,6 +211,7 @@ func Test_run_PreStart(t *testing.T) { } func Test_run_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -283,7 +288,8 @@ func Test_run_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -311,6 +317,7 @@ func Test_run_Start(t *testing.T) { } func Test_run_PreStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -383,7 +390,8 @@ func Test_run_PreStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -411,6 +419,7 @@ func Test_run_PreStop(t *testing.T) { } func Test_run_Stop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -483,7 +492,8 @@ func Test_run_Stop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -511,6 +521,7 @@ func Test_run_Stop(t *testing.T) { } func Test_run_PostStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -583,7 +594,8 @@ func Test_run_PostStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/manager/compressor/config/config_test.go b/pkg/manager/compressor/config/config_test.go index e8090717ea..9a2a62be78 100644 --- a/pkg/manager/compressor/config/config_test.go +++ b/pkg/manager/compressor/config/config_test.go @@ -26,6 +26,7 @@ import ( ) func TestNewConfig(t *testing.T) { + t.Parallel() type args struct { path string } @@ -80,7 +81,8 @@ func TestNewConfig(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/manager/compressor/handler/grpc/handler_test.go b/pkg/manager/compressor/handler/grpc/handler_test.go index 7358d12b93..bfea4f0f9c 100644 --- a/pkg/manager/compressor/handler/grpc/handler_test.go +++ b/pkg/manager/compressor/handler/grpc/handler_test.go @@ -29,6 +29,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -79,7 +80,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -100,6 +102,7 @@ func TestNew(t *testing.T) { } func Test_server_GetVector(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Backup_GetVector_Request @@ -173,7 +176,8 @@ func Test_server_GetVector(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -199,6 +203,7 @@ func Test_server_GetVector(t *testing.T) { } func Test_server_Locations(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Backup_Locations_Request @@ -272,7 +277,8 @@ func Test_server_Locations(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -298,6 +304,7 @@ func Test_server_Locations(t *testing.T) { } func Test_server_Register(t *testing.T) { + t.Parallel() type args struct { ctx context.Context meta *payload.Backup_MetaVector @@ -371,7 +378,8 @@ func Test_server_Register(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -397,6 +405,7 @@ func Test_server_Register(t *testing.T) { } func Test_server_RegisterMulti(t *testing.T) { + t.Parallel() type args struct { ctx context.Context metas *payload.Backup_MetaVectors @@ -470,7 +479,8 @@ func Test_server_RegisterMulti(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -496,6 +506,7 @@ func Test_server_RegisterMulti(t *testing.T) { } func Test_server_Remove(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Backup_Remove_Request @@ -569,7 +580,8 @@ func Test_server_Remove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -595,6 +607,7 @@ func Test_server_Remove(t *testing.T) { } func Test_server_RemoveMulti(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Backup_Remove_RequestMulti @@ -668,7 +681,8 @@ func Test_server_RemoveMulti(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -694,6 +708,7 @@ func Test_server_RemoveMulti(t *testing.T) { } func Test_server_RegisterIPs(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Backup_IP_Register_Request @@ -767,7 +782,8 @@ func Test_server_RegisterIPs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -793,6 +809,7 @@ func Test_server_RegisterIPs(t *testing.T) { } func Test_server_RemoveIPs(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Backup_IP_Remove_Request @@ -866,7 +883,8 @@ func Test_server_RemoveIPs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/manager/compressor/handler/grpc/option_test.go b/pkg/manager/compressor/handler/grpc/option_test.go index b8923df4e2..b6e11acb33 100644 --- a/pkg/manager/compressor/handler/grpc/option_test.go +++ b/pkg/manager/compressor/handler/grpc/option_test.go @@ -25,6 +25,8 @@ import ( ) func TestWithCompressor(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { c service.Compressor @@ -62,7 +64,7 @@ func TestWithCompressor(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -100,7 +102,8 @@ func TestWithCompressor(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -121,7 +124,7 @@ func TestWithCompressor(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -129,7 +132,7 @@ func TestWithCompressor(t *testing.T) { got := WithCompressor(test.args.c) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -138,6 +141,8 @@ func TestWithCompressor(t *testing.T) { } func TestWithBackup(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { b service.Backup @@ -175,7 +180,7 @@ func TestWithBackup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -213,7 +218,8 @@ func TestWithBackup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -234,7 +240,7 @@ func TestWithBackup(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -242,7 +248,7 @@ func TestWithBackup(t *testing.T) { got := WithBackup(test.args.b) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -251,6 +257,8 @@ func TestWithBackup(t *testing.T) { } func TestWithRegisterer(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { r service.Registerer @@ -288,7 +296,7 @@ func TestWithRegisterer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -326,7 +334,8 @@ func TestWithRegisterer(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -347,7 +356,7 @@ func TestWithRegisterer(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -355,7 +364,7 @@ func TestWithRegisterer(t *testing.T) { got := WithRegisterer(test.args.r) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/manager/compressor/handler/rest/handler_test.go b/pkg/manager/compressor/handler/rest/handler_test.go index 326ee7d6d5..6ab964379a 100644 --- a/pkg/manager/compressor/handler/rest/handler_test.go +++ b/pkg/manager/compressor/handler/rest/handler_test.go @@ -28,6 +28,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -78,7 +79,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -99,6 +101,7 @@ func TestNew(t *testing.T) { } func Test_handler_GetVector(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -166,7 +169,8 @@ func Test_handler_GetVector(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -190,6 +194,7 @@ func Test_handler_GetVector(t *testing.T) { } func Test_handler_Locations(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -257,7 +262,8 @@ func Test_handler_Locations(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -281,6 +287,7 @@ func Test_handler_Locations(t *testing.T) { } func Test_handler_Register(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -348,7 +355,8 @@ func Test_handler_Register(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -372,6 +380,7 @@ func Test_handler_Register(t *testing.T) { } func Test_handler_RegisterMulti(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -439,7 +448,8 @@ func Test_handler_RegisterMulti(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -463,6 +473,7 @@ func Test_handler_RegisterMulti(t *testing.T) { } func Test_handler_Remove(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -530,7 +541,8 @@ func Test_handler_Remove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -554,6 +566,7 @@ func Test_handler_Remove(t *testing.T) { } func Test_handler_RemoveMulti(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -621,7 +634,8 @@ func Test_handler_RemoveMulti(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -645,6 +659,7 @@ func Test_handler_RemoveMulti(t *testing.T) { } func Test_handler_RegisterIPs(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -712,7 +727,8 @@ func Test_handler_RegisterIPs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -736,6 +752,7 @@ func Test_handler_RegisterIPs(t *testing.T) { } func Test_handler_RemoveIPs(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -803,7 +820,8 @@ func Test_handler_RemoveIPs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/manager/compressor/handler/rest/option_test.go b/pkg/manager/compressor/handler/rest/option_test.go index cf5e0b5820..4e2acac06f 100644 --- a/pkg/manager/compressor/handler/rest/option_test.go +++ b/pkg/manager/compressor/handler/rest/option_test.go @@ -25,6 +25,8 @@ import ( ) func TestWithBackup(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { b compressor.BackupServer @@ -62,7 +64,7 @@ func TestWithBackup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -100,7 +102,8 @@ func TestWithBackup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -121,7 +124,7 @@ func TestWithBackup(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -129,7 +132,7 @@ func TestWithBackup(t *testing.T) { got := WithBackup(test.args.b) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/manager/compressor/router/option_test.go b/pkg/manager/compressor/router/option_test.go index f779fef14b..2828336054 100644 --- a/pkg/manager/compressor/router/option_test.go +++ b/pkg/manager/compressor/router/option_test.go @@ -26,6 +26,8 @@ import ( ) func TestWithHandler(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { h rest.Handler @@ -63,7 +65,7 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -101,7 +103,8 @@ func TestWithHandler(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -122,7 +125,7 @@ func TestWithHandler(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -130,7 +133,7 @@ func TestWithHandler(t *testing.T) { got := WithHandler(test.args.h) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -139,6 +142,8 @@ func TestWithHandler(t *testing.T) { } func TestWithTimeout(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { timeout string @@ -176,7 +181,7 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -214,7 +219,8 @@ func TestWithTimeout(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -235,7 +241,7 @@ func TestWithTimeout(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -243,7 +249,7 @@ func TestWithTimeout(t *testing.T) { got := WithTimeout(test.args.timeout) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -252,6 +258,8 @@ func TestWithTimeout(t *testing.T) { } func TestWithErrGroup(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { eg errgroup.Group @@ -289,7 +297,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -327,7 +335,8 @@ func TestWithErrGroup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -348,7 +357,7 @@ func TestWithErrGroup(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -356,7 +365,7 @@ func TestWithErrGroup(t *testing.T) { got := WithErrGroup(test.args.eg) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/manager/compressor/router/router_test.go b/pkg/manager/compressor/router/router_test.go index 7be666ccd5..ec7ce94494 100644 --- a/pkg/manager/compressor/router/router_test.go +++ b/pkg/manager/compressor/router/router_test.go @@ -27,6 +27,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -77,7 +78,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/manager/compressor/service/backup_option_test.go b/pkg/manager/compressor/service/backup_option_test.go index 097ff691b2..95c449e4a7 100644 --- a/pkg/manager/compressor/service/backup_option_test.go +++ b/pkg/manager/compressor/service/backup_option_test.go @@ -25,6 +25,8 @@ import ( ) func TestWithBackupAddr(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { addr string @@ -62,7 +64,7 @@ func TestWithBackupAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -100,7 +102,8 @@ func TestWithBackupAddr(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -121,7 +124,7 @@ func TestWithBackupAddr(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -129,7 +132,7 @@ func TestWithBackupAddr(t *testing.T) { got := WithBackupAddr(test.args.addr) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -138,6 +141,8 @@ func TestWithBackupAddr(t *testing.T) { } func TestWithBackupClient(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { client grpc.Client @@ -175,7 +180,7 @@ func TestWithBackupClient(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -213,7 +218,8 @@ func TestWithBackupClient(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -234,7 +240,7 @@ func TestWithBackupClient(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -242,7 +248,7 @@ func TestWithBackupClient(t *testing.T) { got := WithBackupClient(test.args.client) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/manager/compressor/service/backup_test.go b/pkg/manager/compressor/service/backup_test.go index e791c81e52..212ca680e4 100644 --- a/pkg/manager/compressor/service/backup_test.go +++ b/pkg/manager/compressor/service/backup_test.go @@ -28,6 +28,7 @@ import ( ) func TestNewBackup(t *testing.T) { + t.Parallel() type args struct { opts []BackupOption } @@ -82,7 +83,8 @@ func TestNewBackup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -103,6 +105,7 @@ func TestNewBackup(t *testing.T) { } func Test_backup_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -170,7 +173,8 @@ func Test_backup_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -195,6 +199,7 @@ func Test_backup_Start(t *testing.T) { } func Test_backup_GetObject(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uuid string @@ -265,7 +270,8 @@ func Test_backup_GetObject(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -290,6 +296,7 @@ func Test_backup_GetObject(t *testing.T) { } func Test_backup_GetLocation(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uuid string @@ -360,7 +367,8 @@ func Test_backup_GetLocation(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -385,6 +393,7 @@ func Test_backup_GetLocation(t *testing.T) { } func Test_backup_Register(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vec *payload.Backup_Compressed_MetaVector @@ -451,7 +460,8 @@ func Test_backup_Register(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -476,6 +486,7 @@ func Test_backup_Register(t *testing.T) { } func Test_backup_RegisterMultiple(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vecs *payload.Backup_Compressed_MetaVectors @@ -542,7 +553,8 @@ func Test_backup_RegisterMultiple(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -567,6 +579,7 @@ func Test_backup_RegisterMultiple(t *testing.T) { } func Test_backup_Remove(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uuid string @@ -633,7 +646,8 @@ func Test_backup_Remove(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -658,6 +672,7 @@ func Test_backup_Remove(t *testing.T) { } func Test_backup_RemoveMultiple(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uuids []string @@ -724,7 +739,8 @@ func Test_backup_RemoveMultiple(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -749,6 +765,7 @@ func Test_backup_RemoveMultiple(t *testing.T) { } func Test_backup_RegisterIPs(t *testing.T) { + t.Parallel() type args struct { ctx context.Context uuid string @@ -818,7 +835,8 @@ func Test_backup_RegisterIPs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -843,6 +861,7 @@ func Test_backup_RegisterIPs(t *testing.T) { } func Test_backup_RemoveIPs(t *testing.T) { + t.Parallel() type args struct { ctx context.Context ips []string @@ -909,7 +928,8 @@ func Test_backup_RemoveIPs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/manager/compressor/service/compress_option_test.go b/pkg/manager/compressor/service/compress_option_test.go index 17dfd67978..6f621465a3 100644 --- a/pkg/manager/compressor/service/compress_option_test.go +++ b/pkg/manager/compressor/service/compress_option_test.go @@ -26,6 +26,8 @@ import ( ) func TestWithCompressAlgorithm(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { name string @@ -63,7 +65,7 @@ func TestWithCompressAlgorithm(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -101,7 +103,8 @@ func TestWithCompressAlgorithm(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -122,7 +125,7 @@ func TestWithCompressAlgorithm(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -130,7 +133,7 @@ func TestWithCompressAlgorithm(t *testing.T) { got := WithCompressAlgorithm(test.args.name) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -139,6 +142,8 @@ func TestWithCompressAlgorithm(t *testing.T) { } func TestWithCompressionLevel(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { level int @@ -176,7 +181,7 @@ func TestWithCompressionLevel(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -214,7 +219,8 @@ func TestWithCompressionLevel(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -235,7 +241,7 @@ func TestWithCompressionLevel(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -243,7 +249,7 @@ func TestWithCompressionLevel(t *testing.T) { got := WithCompressionLevel(test.args.level) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -252,6 +258,8 @@ func TestWithCompressionLevel(t *testing.T) { } func TestWithCompressorWorker(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { opts []worker.WorkerOption @@ -289,7 +297,7 @@ func TestWithCompressorWorker(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -327,7 +335,8 @@ func TestWithCompressorWorker(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -348,7 +357,7 @@ func TestWithCompressorWorker(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -356,7 +365,7 @@ func TestWithCompressorWorker(t *testing.T) { got := WithCompressorWorker(test.args.opts...) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -365,6 +374,8 @@ func TestWithCompressorWorker(t *testing.T) { } func TestWithCompressorErrGroup(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { eg errgroup.Group @@ -402,7 +413,7 @@ func TestWithCompressorErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -440,7 +451,8 @@ func TestWithCompressorErrGroup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -461,7 +473,7 @@ func TestWithCompressorErrGroup(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -469,7 +481,7 @@ func TestWithCompressorErrGroup(t *testing.T) { got := WithCompressorErrGroup(test.args.eg) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/manager/compressor/service/compress_test.go b/pkg/manager/compressor/service/compress_test.go index fdecde87bb..0b6cb0b9e3 100644 --- a/pkg/manager/compressor/service/compress_test.go +++ b/pkg/manager/compressor/service/compress_test.go @@ -29,6 +29,7 @@ import ( ) func TestNewCompressor(t *testing.T) { + t.Parallel() type args struct { opts []CompressorOption } @@ -83,7 +84,8 @@ func TestNewCompressor(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -104,6 +106,7 @@ func TestNewCompressor(t *testing.T) { } func Test_compressor_PreStart(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -179,7 +182,8 @@ func Test_compressor_PreStart(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -208,6 +212,7 @@ func Test_compressor_PreStart(t *testing.T) { } func Test_compressor_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -287,7 +292,8 @@ func Test_compressor_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -316,6 +322,7 @@ func Test_compressor_Start(t *testing.T) { } func Test_compressor_dispatchCompress(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vectors [][]float32 @@ -398,7 +405,8 @@ func Test_compressor_dispatchCompress(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -427,6 +435,7 @@ func Test_compressor_dispatchCompress(t *testing.T) { } func Test_compressor_dispatchDecompress(t *testing.T) { + t.Parallel() type args struct { ctx context.Context bytess [][]byte @@ -509,7 +518,8 @@ func Test_compressor_dispatchDecompress(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -538,6 +548,7 @@ func Test_compressor_dispatchDecompress(t *testing.T) { } func Test_compressor_Compress(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vector []float32 @@ -620,7 +631,8 @@ func Test_compressor_Compress(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -649,6 +661,7 @@ func Test_compressor_Compress(t *testing.T) { } func Test_compressor_Decompress(t *testing.T) { + t.Parallel() type args struct { ctx context.Context bytes []byte @@ -731,7 +744,8 @@ func Test_compressor_Decompress(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -760,6 +774,7 @@ func Test_compressor_Decompress(t *testing.T) { } func Test_compressor_MultiCompress(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vectors [][]float32 @@ -842,7 +857,8 @@ func Test_compressor_MultiCompress(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -871,6 +887,7 @@ func Test_compressor_MultiCompress(t *testing.T) { } func Test_compressor_MultiDecompress(t *testing.T) { + t.Parallel() type args struct { ctx context.Context bytess [][]byte @@ -953,7 +970,8 @@ func Test_compressor_MultiDecompress(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -982,6 +1000,7 @@ func Test_compressor_MultiDecompress(t *testing.T) { } func Test_compressor_Len(t *testing.T) { + t.Parallel() type fields struct { algorithm string compressionLevel int @@ -1047,7 +1066,8 @@ func Test_compressor_Len(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -1076,6 +1096,7 @@ func Test_compressor_Len(t *testing.T) { } func Test_compressor_TotalRequested(t *testing.T) { + t.Parallel() type fields struct { algorithm string compressionLevel int @@ -1141,7 +1162,8 @@ func Test_compressor_TotalRequested(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -1170,6 +1192,7 @@ func Test_compressor_TotalRequested(t *testing.T) { } func Test_compressor_TotalCompleted(t *testing.T) { + t.Parallel() type fields struct { algorithm string compressionLevel int @@ -1235,7 +1258,8 @@ func Test_compressor_TotalCompleted(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } diff --git a/pkg/manager/compressor/service/registerer_option_test.go b/pkg/manager/compressor/service/registerer_option_test.go index e440deb877..01abef6376 100644 --- a/pkg/manager/compressor/service/registerer_option_test.go +++ b/pkg/manager/compressor/service/registerer_option_test.go @@ -27,6 +27,8 @@ import ( ) func TestWithRegistererWorker(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { opts []worker.WorkerOption @@ -64,7 +66,7 @@ func TestWithRegistererWorker(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -102,7 +104,8 @@ func TestWithRegistererWorker(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -123,7 +126,7 @@ func TestWithRegistererWorker(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -131,7 +134,7 @@ func TestWithRegistererWorker(t *testing.T) { got := WithRegistererWorker(test.args.opts...) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -140,6 +143,8 @@ func TestWithRegistererWorker(t *testing.T) { } func TestWithRegistererErrGroup(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { eg errgroup.Group @@ -177,7 +182,7 @@ func TestWithRegistererErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -215,7 +220,8 @@ func TestWithRegistererErrGroup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -236,7 +242,7 @@ func TestWithRegistererErrGroup(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -244,7 +250,7 @@ func TestWithRegistererErrGroup(t *testing.T) { got := WithRegistererErrGroup(test.args.eg) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -253,6 +259,8 @@ func TestWithRegistererErrGroup(t *testing.T) { } func TestWithRegistererBackup(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { b Backup @@ -290,7 +298,7 @@ func TestWithRegistererBackup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -328,7 +336,8 @@ func TestWithRegistererBackup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -349,7 +358,7 @@ func TestWithRegistererBackup(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -357,7 +366,7 @@ func TestWithRegistererBackup(t *testing.T) { got := WithRegistererBackup(test.args.b) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -366,6 +375,8 @@ func TestWithRegistererBackup(t *testing.T) { } func TestWithRegistererCompressor(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { c Compressor @@ -403,7 +414,7 @@ func TestWithRegistererCompressor(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -441,7 +452,8 @@ func TestWithRegistererCompressor(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -462,7 +474,7 @@ func TestWithRegistererCompressor(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -470,7 +482,7 @@ func TestWithRegistererCompressor(t *testing.T) { got := WithRegistererCompressor(test.args.c) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -479,6 +491,8 @@ func TestWithRegistererCompressor(t *testing.T) { } func TestWithRegistererClient(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { c client.Client @@ -516,7 +530,7 @@ func TestWithRegistererClient(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -554,7 +568,8 @@ func TestWithRegistererClient(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -575,7 +590,7 @@ func TestWithRegistererClient(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -583,7 +598,7 @@ func TestWithRegistererClient(t *testing.T) { got := WithRegistererClient(test.args.c) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/manager/compressor/service/registerer_test.go b/pkg/manager/compressor/service/registerer_test.go index cc6127bbfd..edec8250db 100644 --- a/pkg/manager/compressor/service/registerer_test.go +++ b/pkg/manager/compressor/service/registerer_test.go @@ -31,6 +31,7 @@ import ( ) func TestNewRegisterer(t *testing.T) { + t.Parallel() type args struct { opts []RegistererOption } @@ -85,7 +86,8 @@ func TestNewRegisterer(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -106,6 +108,7 @@ func TestNewRegisterer(t *testing.T) { } func Test_registerer_PreStart(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -187,7 +190,8 @@ func Test_registerer_PreStart(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -218,6 +222,7 @@ func Test_registerer_PreStart(t *testing.T) { } func Test_registerer_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -303,7 +308,8 @@ func Test_registerer_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -334,6 +340,7 @@ func Test_registerer_Start(t *testing.T) { } func Test_registerer_PostStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -415,7 +422,8 @@ func Test_registerer_PostStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -446,6 +454,7 @@ func Test_registerer_PostStop(t *testing.T) { } func Test_registerer_Register(t *testing.T) { + t.Parallel() type args struct { ctx context.Context meta *payload.Backup_MetaVector @@ -530,7 +539,8 @@ func Test_registerer_Register(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -561,6 +571,7 @@ func Test_registerer_Register(t *testing.T) { } func Test_registerer_RegisterMulti(t *testing.T) { + t.Parallel() type args struct { ctx context.Context metas *payload.Backup_MetaVectors @@ -645,7 +656,8 @@ func Test_registerer_RegisterMulti(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -676,6 +688,7 @@ func Test_registerer_RegisterMulti(t *testing.T) { } func Test_registerer_Len(t *testing.T) { + t.Parallel() type fields struct { worker worker.Worker workerOpts []worker.WorkerOption @@ -747,7 +760,8 @@ func Test_registerer_Len(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -778,6 +792,7 @@ func Test_registerer_Len(t *testing.T) { } func Test_registerer_TotalRequested(t *testing.T) { + t.Parallel() type fields struct { worker worker.Worker workerOpts []worker.WorkerOption @@ -849,7 +864,8 @@ func Test_registerer_TotalRequested(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -880,6 +896,7 @@ func Test_registerer_TotalRequested(t *testing.T) { } func Test_registerer_TotalCompleted(t *testing.T) { + t.Parallel() type fields struct { worker worker.Worker workerOpts []worker.WorkerOption @@ -951,7 +968,8 @@ func Test_registerer_TotalCompleted(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -982,6 +1000,7 @@ func Test_registerer_TotalCompleted(t *testing.T) { } func Test_registerer_dispatch(t *testing.T) { + t.Parallel() type args struct { ctx context.Context meta *payload.Backup_MetaVector @@ -1066,7 +1085,8 @@ func Test_registerer_dispatch(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1097,6 +1117,7 @@ func Test_registerer_dispatch(t *testing.T) { } func Test_registerer_registerProcessFunc(t *testing.T) { + t.Parallel() type args struct { meta *payload.Backup_MetaVector } @@ -1178,7 +1199,8 @@ func Test_registerer_registerProcessFunc(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1209,6 +1231,7 @@ func Test_registerer_registerProcessFunc(t *testing.T) { } func Test_registerer_forwardMetas(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -1290,7 +1313,8 @@ func Test_registerer_forwardMetas(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/manager/compressor/usecase/compressord_test.go b/pkg/manager/compressor/usecase/compressord_test.go index 0011b29906..bd0be79a62 100644 --- a/pkg/manager/compressor/usecase/compressord_test.go +++ b/pkg/manager/compressor/usecase/compressord_test.go @@ -32,6 +32,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { cfg *config.Data } @@ -86,7 +87,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -107,6 +109,7 @@ func TestNew(t *testing.T) { } func Test_run_PreStart(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -185,7 +188,8 @@ func Test_run_PreStart(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -215,6 +219,7 @@ func Test_run_PreStart(t *testing.T) { } func Test_run_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -297,7 +302,8 @@ func Test_run_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -327,6 +333,7 @@ func Test_run_Start(t *testing.T) { } func Test_run_PreStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -405,7 +412,8 @@ func Test_run_PreStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -435,6 +443,7 @@ func Test_run_PreStop(t *testing.T) { } func Test_run_Stop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -513,7 +522,8 @@ func Test_run_Stop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -543,6 +553,7 @@ func Test_run_Stop(t *testing.T) { } func Test_run_PostStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -621,7 +632,8 @@ func Test_run_PostStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/manager/index/config/config_test.go b/pkg/manager/index/config/config_test.go index e8090717ea..9a2a62be78 100644 --- a/pkg/manager/index/config/config_test.go +++ b/pkg/manager/index/config/config_test.go @@ -26,6 +26,7 @@ import ( ) func TestNewConfig(t *testing.T) { + t.Parallel() type args struct { path string } @@ -80,7 +81,8 @@ func TestNewConfig(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/manager/index/handler/grpc/checklist_test.go b/pkg/manager/index/handler/grpc/checklist_test.go index 92f898b919..6cf7441259 100644 --- a/pkg/manager/index/handler/grpc/checklist_test.go +++ b/pkg/manager/index/handler/grpc/checklist_test.go @@ -28,6 +28,7 @@ import ( ) func Test_checkList_Exists(t *testing.T) { + t.Parallel() type args struct { key string } @@ -97,7 +98,8 @@ func Test_checkList_Exists(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -124,6 +126,7 @@ func Test_checkList_Exists(t *testing.T) { } func Test_checkList_Check(t *testing.T) { + t.Parallel() type args struct { key string } @@ -189,7 +192,8 @@ func Test_checkList_Check(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -215,6 +219,7 @@ func Test_checkList_Check(t *testing.T) { } func Test_entryCheckList_tryStore(t *testing.T) { + t.Parallel() type args struct { i *struct{} } @@ -275,7 +280,8 @@ func Test_entryCheckList_tryStore(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -299,6 +305,7 @@ func Test_entryCheckList_tryStore(t *testing.T) { } func Test_entryCheckList_unexpungeLocked(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -349,7 +356,8 @@ func Test_entryCheckList_unexpungeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -373,6 +381,7 @@ func Test_entryCheckList_unexpungeLocked(t *testing.T) { } func Test_checkList_missLocked(t *testing.T) { + t.Parallel() type fields struct { mu sync.Mutex read atomic.Value @@ -428,7 +437,8 @@ func Test_checkList_missLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -454,6 +464,7 @@ func Test_checkList_missLocked(t *testing.T) { } func Test_checkList_dirtyLocked(t *testing.T) { + t.Parallel() type fields struct { mu sync.Mutex read atomic.Value @@ -509,7 +520,8 @@ func Test_checkList_dirtyLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -535,6 +547,7 @@ func Test_checkList_dirtyLocked(t *testing.T) { } func Test_entryCheckList_tryExpungeLocked(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -585,7 +598,8 @@ func Test_entryCheckList_tryExpungeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } diff --git a/pkg/manager/index/handler/grpc/handler_test.go b/pkg/manager/index/handler/grpc/handler_test.go index bd93589617..fe7a848446 100644 --- a/pkg/manager/index/handler/grpc/handler_test.go +++ b/pkg/manager/index/handler/grpc/handler_test.go @@ -30,6 +30,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -80,7 +81,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -101,6 +103,7 @@ func TestNew(t *testing.T) { } func Test_server_IndexInfo(t *testing.T) { + t.Parallel() type args struct { ctx context.Context in1 *payload.Empty @@ -168,7 +171,8 @@ func Test_server_IndexInfo(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/manager/index/handler/grpc/option_test.go b/pkg/manager/index/handler/grpc/option_test.go index 4f0ec460a7..f2a6e62165 100644 --- a/pkg/manager/index/handler/grpc/option_test.go +++ b/pkg/manager/index/handler/grpc/option_test.go @@ -25,6 +25,8 @@ import ( ) func TestWithIndexer(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { i service.Indexer @@ -62,7 +64,7 @@ func TestWithIndexer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -100,7 +102,8 @@ func TestWithIndexer(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -121,7 +124,7 @@ func TestWithIndexer(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -129,7 +132,7 @@ func TestWithIndexer(t *testing.T) { got := WithIndexer(test.args.i) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/manager/index/handler/rest/handler_test.go b/pkg/manager/index/handler/rest/handler_test.go index 63fa1415a5..7698eb7cd3 100644 --- a/pkg/manager/index/handler/rest/handler_test.go +++ b/pkg/manager/index/handler/rest/handler_test.go @@ -28,6 +28,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -78,7 +79,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -99,6 +101,7 @@ func TestNew(t *testing.T) { } func Test_handler_Index(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -166,7 +169,8 @@ func Test_handler_Index(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -190,6 +194,7 @@ func Test_handler_Index(t *testing.T) { } func Test_handler_IndexInfo(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -257,7 +262,8 @@ func Test_handler_IndexInfo(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/manager/index/handler/rest/option_test.go b/pkg/manager/index/handler/rest/option_test.go index d96793be5d..28bb6ed722 100644 --- a/pkg/manager/index/handler/rest/option_test.go +++ b/pkg/manager/index/handler/rest/option_test.go @@ -25,6 +25,8 @@ import ( ) func TestWithIndexer(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { i index.IndexServer @@ -62,7 +64,7 @@ func TestWithIndexer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -100,7 +102,8 @@ func TestWithIndexer(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -121,7 +124,7 @@ func TestWithIndexer(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -129,7 +132,7 @@ func TestWithIndexer(t *testing.T) { got := WithIndexer(test.args.i) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/manager/index/router/option_test.go b/pkg/manager/index/router/option_test.go index 30248a777e..6ae9bec852 100644 --- a/pkg/manager/index/router/option_test.go +++ b/pkg/manager/index/router/option_test.go @@ -25,6 +25,8 @@ import ( ) func TestWithHandler(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { h rest.Handler @@ -62,7 +64,7 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -100,7 +102,8 @@ func TestWithHandler(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -121,7 +124,7 @@ func TestWithHandler(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -129,7 +132,7 @@ func TestWithHandler(t *testing.T) { got := WithHandler(test.args.h) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -138,6 +141,8 @@ func TestWithHandler(t *testing.T) { } func TestWithTimeout(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { timeout string @@ -175,7 +180,7 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -213,7 +218,8 @@ func TestWithTimeout(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -234,7 +240,7 @@ func TestWithTimeout(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -242,7 +248,7 @@ func TestWithTimeout(t *testing.T) { got := WithTimeout(test.args.timeout) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/manager/index/router/router_test.go b/pkg/manager/index/router/router_test.go index 7be666ccd5..ec7ce94494 100644 --- a/pkg/manager/index/router/router_test.go +++ b/pkg/manager/index/router/router_test.go @@ -27,6 +27,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -77,7 +78,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/manager/index/service/indexer_test.go b/pkg/manager/index/service/indexer_test.go index 86e9693df3..a6fb78c388 100644 --- a/pkg/manager/index/service/indexer_test.go +++ b/pkg/manager/index/service/indexer_test.go @@ -31,6 +31,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -85,7 +86,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -106,6 +108,7 @@ func TestNew(t *testing.T) { } func Test_index_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -206,7 +209,8 @@ func Test_index_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -242,6 +246,7 @@ func Test_index_Start(t *testing.T) { } func Test_index_execute(t *testing.T) { + t.Parallel() type args struct { ctx context.Context enableLowIndexSkip bool @@ -341,7 +346,8 @@ func Test_index_execute(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -377,6 +383,7 @@ func Test_index_execute(t *testing.T) { } func Test_index_loadInfos(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -473,7 +480,8 @@ func Test_index_loadInfos(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -509,6 +517,7 @@ func Test_index_loadInfos(t *testing.T) { } func Test_index_IsIndexing(t *testing.T) { + t.Parallel() type fields struct { client discoverer.Client eg errgroup.Group @@ -595,7 +604,8 @@ func Test_index_IsIndexing(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -631,6 +641,7 @@ func Test_index_IsIndexing(t *testing.T) { } func Test_index_NumberOfUUIDs(t *testing.T) { + t.Parallel() type fields struct { client discoverer.Client eg errgroup.Group @@ -717,7 +728,8 @@ func Test_index_NumberOfUUIDs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -753,6 +765,7 @@ func Test_index_NumberOfUUIDs(t *testing.T) { } func Test_index_NumberOfUncommittedUUIDs(t *testing.T) { + t.Parallel() type fields struct { client discoverer.Client eg errgroup.Group @@ -839,7 +852,8 @@ func Test_index_NumberOfUncommittedUUIDs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } diff --git a/pkg/manager/index/service/indexinfos_test.go b/pkg/manager/index/service/indexinfos_test.go index ca3d08f5ca..a1b6d3c97f 100644 --- a/pkg/manager/index/service/indexinfos_test.go +++ b/pkg/manager/index/service/indexinfos_test.go @@ -29,6 +29,7 @@ import ( ) func Test_newEntryIndexInfos(t *testing.T) { + t.Parallel() type args struct { i *payload.Info_Index_Count } @@ -79,7 +80,8 @@ func Test_newEntryIndexInfos(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -100,6 +102,7 @@ func Test_newEntryIndexInfos(t *testing.T) { } func Test_indexInfos_Load(t *testing.T) { + t.Parallel() type args struct { key string } @@ -173,7 +176,8 @@ func Test_indexInfos_Load(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -200,6 +204,7 @@ func Test_indexInfos_Load(t *testing.T) { } func Test_entryIndexInfos_load(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -254,7 +259,8 @@ func Test_entryIndexInfos_load(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -278,6 +284,7 @@ func Test_entryIndexInfos_load(t *testing.T) { } func Test_indexInfos_Store(t *testing.T) { + t.Parallel() type args struct { key string value *payload.Info_Index_Count @@ -346,7 +353,8 @@ func Test_indexInfos_Store(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -372,6 +380,7 @@ func Test_indexInfos_Store(t *testing.T) { } func Test_entryIndexInfos_tryStore(t *testing.T) { + t.Parallel() type args struct { i **payload.Info_Index_Count } @@ -432,7 +441,8 @@ func Test_entryIndexInfos_tryStore(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -456,6 +466,7 @@ func Test_entryIndexInfos_tryStore(t *testing.T) { } func Test_entryIndexInfos_unexpungeLocked(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -506,7 +517,8 @@ func Test_entryIndexInfos_unexpungeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -530,6 +542,7 @@ func Test_entryIndexInfos_unexpungeLocked(t *testing.T) { } func Test_entryIndexInfos_storeLocked(t *testing.T) { + t.Parallel() type args struct { i **payload.Info_Index_Count } @@ -586,7 +599,8 @@ func Test_entryIndexInfos_storeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -609,6 +623,7 @@ func Test_entryIndexInfos_storeLocked(t *testing.T) { } func Test_indexInfos_Delete(t *testing.T) { + t.Parallel() type args struct { key string } @@ -674,7 +689,8 @@ func Test_indexInfos_Delete(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -700,6 +716,7 @@ func Test_indexInfos_Delete(t *testing.T) { } func Test_entryIndexInfos_delete(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -750,7 +767,8 @@ func Test_entryIndexInfos_delete(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -774,6 +792,7 @@ func Test_entryIndexInfos_delete(t *testing.T) { } func Test_indexInfos_Range(t *testing.T) { + t.Parallel() type args struct { f func(key string, value *payload.Info_Index_Count) bool } @@ -839,7 +858,8 @@ func Test_indexInfos_Range(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -865,6 +885,7 @@ func Test_indexInfos_Range(t *testing.T) { } func Test_indexInfos_missLocked(t *testing.T) { + t.Parallel() type fields struct { mu sync.Mutex read atomic.Value @@ -920,7 +941,8 @@ func Test_indexInfos_missLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -946,6 +968,7 @@ func Test_indexInfos_missLocked(t *testing.T) { } func Test_indexInfos_dirtyLocked(t *testing.T) { + t.Parallel() type fields struct { mu sync.Mutex read atomic.Value @@ -1001,7 +1024,8 @@ func Test_indexInfos_dirtyLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -1027,6 +1051,7 @@ func Test_indexInfos_dirtyLocked(t *testing.T) { } func Test_entryIndexInfos_tryExpungeLocked(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -1077,7 +1102,8 @@ func Test_entryIndexInfos_tryExpungeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } diff --git a/pkg/manager/index/service/option_test.go b/pkg/manager/index/service/option_test.go index e3d5eefeee..ef9e525f6a 100644 --- a/pkg/manager/index/service/option_test.go +++ b/pkg/manager/index/service/option_test.go @@ -26,6 +26,8 @@ import ( ) func TestWithIndexingConcurrency(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { c int @@ -63,7 +65,7 @@ func TestWithIndexingConcurrency(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -101,7 +103,8 @@ func TestWithIndexingConcurrency(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -122,7 +125,7 @@ func TestWithIndexingConcurrency(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -130,7 +133,7 @@ func TestWithIndexingConcurrency(t *testing.T) { got := WithIndexingConcurrency(test.args.c) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -139,6 +142,8 @@ func TestWithIndexingConcurrency(t *testing.T) { } func TestWithIndexingDuration(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { dur string @@ -176,7 +181,7 @@ func TestWithIndexingDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -214,7 +219,8 @@ func TestWithIndexingDuration(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -235,7 +241,7 @@ func TestWithIndexingDuration(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -243,7 +249,7 @@ func TestWithIndexingDuration(t *testing.T) { got := WithIndexingDuration(test.args.dur) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -252,6 +258,8 @@ func TestWithIndexingDuration(t *testing.T) { } func TestWithIndexingDurationLimit(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { dur string @@ -289,7 +297,7 @@ func TestWithIndexingDurationLimit(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -327,7 +335,8 @@ func TestWithIndexingDurationLimit(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -348,7 +357,7 @@ func TestWithIndexingDurationLimit(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -356,7 +365,7 @@ func TestWithIndexingDurationLimit(t *testing.T) { got := WithIndexingDurationLimit(test.args.dur) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -365,6 +374,8 @@ func TestWithIndexingDurationLimit(t *testing.T) { } func TestWithMinUncommitted(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { n uint32 @@ -402,7 +413,7 @@ func TestWithMinUncommitted(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -440,7 +451,8 @@ func TestWithMinUncommitted(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -461,7 +473,7 @@ func TestWithMinUncommitted(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -469,7 +481,7 @@ func TestWithMinUncommitted(t *testing.T) { got := WithMinUncommitted(test.args.n) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -478,6 +490,8 @@ func TestWithMinUncommitted(t *testing.T) { } func TestWithCreationPoolSize(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { size uint32 @@ -515,7 +529,7 @@ func TestWithCreationPoolSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -553,7 +567,8 @@ func TestWithCreationPoolSize(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -574,7 +589,7 @@ func TestWithCreationPoolSize(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -582,7 +597,7 @@ func TestWithCreationPoolSize(t *testing.T) { got := WithCreationPoolSize(test.args.size) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -591,6 +606,8 @@ func TestWithCreationPoolSize(t *testing.T) { } func TestWithDiscoverer(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { c discoverer.Client @@ -628,7 +645,7 @@ func TestWithDiscoverer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -666,7 +683,8 @@ func TestWithDiscoverer(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -687,7 +705,7 @@ func TestWithDiscoverer(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -695,7 +713,7 @@ func TestWithDiscoverer(t *testing.T) { got := WithDiscoverer(test.args.c) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -704,6 +722,8 @@ func TestWithDiscoverer(t *testing.T) { } func TestWithErrGroup(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { eg errgroup.Group @@ -741,7 +761,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -779,7 +799,8 @@ func TestWithErrGroup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -800,7 +821,7 @@ func TestWithErrGroup(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -808,7 +829,7 @@ func TestWithErrGroup(t *testing.T) { got := WithErrGroup(test.args.eg) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/manager/index/usecase/indexer_test.go b/pkg/manager/index/usecase/indexer_test.go index 750f42fdcd..f87cc127c4 100644 --- a/pkg/manager/index/usecase/indexer_test.go +++ b/pkg/manager/index/usecase/indexer_test.go @@ -32,6 +32,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { cfg *config.Data } @@ -86,7 +87,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -107,6 +109,7 @@ func TestNew(t *testing.T) { } func Test_run_PreStart(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -179,7 +182,8 @@ func Test_run_PreStart(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -207,6 +211,7 @@ func Test_run_PreStart(t *testing.T) { } func Test_run_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -283,7 +288,8 @@ func Test_run_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -311,6 +317,7 @@ func Test_run_Start(t *testing.T) { } func Test_run_PreStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -383,7 +390,8 @@ func Test_run_PreStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -411,6 +419,7 @@ func Test_run_PreStop(t *testing.T) { } func Test_run_Stop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -483,7 +492,8 @@ func Test_run_Stop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -511,6 +521,7 @@ func Test_run_Stop(t *testing.T) { } func Test_run_PostStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -583,7 +594,8 @@ func Test_run_PostStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/manager/replication/agent/config/config_test.go b/pkg/manager/replication/agent/config/config_test.go index e8090717ea..9a2a62be78 100644 --- a/pkg/manager/replication/agent/config/config_test.go +++ b/pkg/manager/replication/agent/config/config_test.go @@ -26,6 +26,7 @@ import ( ) func TestNewConfig(t *testing.T) { + t.Parallel() type args struct { path string } @@ -80,7 +81,8 @@ func TestNewConfig(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/manager/replication/agent/handler/grpc/handler_test.go b/pkg/manager/replication/agent/handler/grpc/handler_test.go index 147ea029ba..58ed5daa81 100644 --- a/pkg/manager/replication/agent/handler/grpc/handler_test.go +++ b/pkg/manager/replication/agent/handler/grpc/handler_test.go @@ -29,6 +29,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -79,7 +80,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -100,6 +102,7 @@ func TestNew(t *testing.T) { } func Test_server_Recover(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Replication_Recovery @@ -167,7 +170,8 @@ func Test_server_Recover(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -191,6 +195,7 @@ func Test_server_Recover(t *testing.T) { } func Test_server_Rebalance(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Replication_Rebalance @@ -258,7 +263,8 @@ func Test_server_Rebalance(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -282,6 +288,7 @@ func Test_server_Rebalance(t *testing.T) { } func Test_server_AgentInfo(t *testing.T) { + t.Parallel() type args struct { ctx context.Context req *payload.Empty @@ -349,7 +356,8 @@ func Test_server_AgentInfo(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/manager/replication/agent/handler/grpc/option_test.go b/pkg/manager/replication/agent/handler/grpc/option_test.go index 0f278cb055..ea3a7fb7a1 100644 --- a/pkg/manager/replication/agent/handler/grpc/option_test.go +++ b/pkg/manager/replication/agent/handler/grpc/option_test.go @@ -25,6 +25,8 @@ import ( ) func TestWithReplicator(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { rep service.Replicator @@ -62,7 +64,7 @@ func TestWithReplicator(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -100,7 +102,8 @@ func TestWithReplicator(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -121,7 +124,7 @@ func TestWithReplicator(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -129,7 +132,7 @@ func TestWithReplicator(t *testing.T) { got := WithReplicator(test.args.rep) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/manager/replication/agent/handler/rest/handler_test.go b/pkg/manager/replication/agent/handler/rest/handler_test.go index ca48a04552..72aa7d3d91 100644 --- a/pkg/manager/replication/agent/handler/rest/handler_test.go +++ b/pkg/manager/replication/agent/handler/rest/handler_test.go @@ -28,6 +28,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -78,7 +79,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -99,6 +101,7 @@ func TestNew(t *testing.T) { } func Test_handler_Recover(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -166,7 +169,8 @@ func Test_handler_Recover(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -190,6 +194,7 @@ func Test_handler_Recover(t *testing.T) { } func Test_handler_Rebalance(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -257,7 +262,8 @@ func Test_handler_Rebalance(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -281,6 +287,7 @@ func Test_handler_Rebalance(t *testing.T) { } func Test_handler_AgentInfo(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -348,7 +355,8 @@ func Test_handler_AgentInfo(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/manager/replication/agent/handler/rest/option_test.go b/pkg/manager/replication/agent/handler/rest/option_test.go index ced8c00ab5..3d455c37ea 100644 --- a/pkg/manager/replication/agent/handler/rest/option_test.go +++ b/pkg/manager/replication/agent/handler/rest/option_test.go @@ -25,6 +25,8 @@ import ( ) func TestWithReplicator(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { reps agent.ReplicationServer @@ -62,7 +64,7 @@ func TestWithReplicator(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -100,7 +102,8 @@ func TestWithReplicator(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -121,7 +124,7 @@ func TestWithReplicator(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -129,7 +132,7 @@ func TestWithReplicator(t *testing.T) { got := WithReplicator(test.args.reps) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/manager/replication/agent/router/option_test.go b/pkg/manager/replication/agent/router/option_test.go index 5c4b8b628d..46b449304f 100644 --- a/pkg/manager/replication/agent/router/option_test.go +++ b/pkg/manager/replication/agent/router/option_test.go @@ -26,6 +26,8 @@ import ( ) func TestWithHandler(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { h rest.Handler @@ -63,7 +65,7 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -101,7 +103,8 @@ func TestWithHandler(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -122,7 +125,7 @@ func TestWithHandler(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -130,7 +133,7 @@ func TestWithHandler(t *testing.T) { got := WithHandler(test.args.h) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -139,6 +142,8 @@ func TestWithHandler(t *testing.T) { } func TestWithTimeout(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { timeout string @@ -176,7 +181,7 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -214,7 +219,8 @@ func TestWithTimeout(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -235,7 +241,7 @@ func TestWithTimeout(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -243,7 +249,7 @@ func TestWithTimeout(t *testing.T) { got := WithTimeout(test.args.timeout) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -252,6 +258,8 @@ func TestWithTimeout(t *testing.T) { } func TestWithErrGroup(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { eg errgroup.Group @@ -289,7 +297,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -327,7 +335,8 @@ func TestWithErrGroup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -348,7 +357,7 @@ func TestWithErrGroup(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -356,7 +365,7 @@ func TestWithErrGroup(t *testing.T) { got := WithErrGroup(test.args.eg) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/manager/replication/agent/router/router_test.go b/pkg/manager/replication/agent/router/router_test.go index 7be666ccd5..ec7ce94494 100644 --- a/pkg/manager/replication/agent/router/router_test.go +++ b/pkg/manager/replication/agent/router/router_test.go @@ -27,6 +27,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -77,7 +78,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/manager/replication/agent/service/agent_test.go b/pkg/manager/replication/agent/service/agent_test.go index 0f9e4fb34f..3dd11d78c3 100644 --- a/pkg/manager/replication/agent/service/agent_test.go +++ b/pkg/manager/replication/agent/service/agent_test.go @@ -25,6 +25,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type want struct { want Replicator } @@ -65,7 +66,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } diff --git a/pkg/manager/replication/agent/usecase/backupd_test.go b/pkg/manager/replication/agent/usecase/backupd_test.go index 9ac3f3e056..51c7822d0e 100644 --- a/pkg/manager/replication/agent/usecase/backupd_test.go +++ b/pkg/manager/replication/agent/usecase/backupd_test.go @@ -32,6 +32,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { cfg *config.Data } @@ -86,7 +87,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -107,6 +109,7 @@ func TestNew(t *testing.T) { } func Test_run_PreStart(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -179,7 +182,8 @@ func Test_run_PreStart(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -207,6 +211,7 @@ func Test_run_PreStart(t *testing.T) { } func Test_run_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -283,7 +288,8 @@ func Test_run_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -311,6 +317,7 @@ func Test_run_Start(t *testing.T) { } func Test_run_PreStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -383,7 +390,8 @@ func Test_run_PreStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -411,6 +419,7 @@ func Test_run_PreStop(t *testing.T) { } func Test_run_Stop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -483,7 +492,8 @@ func Test_run_Stop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -511,6 +521,7 @@ func Test_run_Stop(t *testing.T) { } func Test_run_PostStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -583,7 +594,8 @@ func Test_run_PostStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/manager/replication/controller/config/config_test.go b/pkg/manager/replication/controller/config/config_test.go index e8090717ea..9a2a62be78 100644 --- a/pkg/manager/replication/controller/config/config_test.go +++ b/pkg/manager/replication/controller/config/config_test.go @@ -26,6 +26,7 @@ import ( ) func TestNewConfig(t *testing.T) { + t.Parallel() type args struct { path string } @@ -80,7 +81,8 @@ func TestNewConfig(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/manager/replication/controller/handler/grpc/handler_test.go b/pkg/manager/replication/controller/handler/grpc/handler_test.go index 2080faa898..fc1b53417e 100644 --- a/pkg/manager/replication/controller/handler/grpc/handler_test.go +++ b/pkg/manager/replication/controller/handler/grpc/handler_test.go @@ -30,6 +30,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -80,7 +81,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -101,6 +103,7 @@ func TestNew(t *testing.T) { } func Test_server_ReplicationInfo(t *testing.T) { + t.Parallel() type args struct { ctx context.Context in1 *payload.Empty @@ -168,7 +171,8 @@ func Test_server_ReplicationInfo(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/manager/replication/controller/handler/grpc/option_test.go b/pkg/manager/replication/controller/handler/grpc/option_test.go index 98af333b83..8b03b3b841 100644 --- a/pkg/manager/replication/controller/handler/grpc/option_test.go +++ b/pkg/manager/replication/controller/handler/grpc/option_test.go @@ -25,6 +25,8 @@ import ( ) func TestWithReplicator(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { ctrl service.Replicator @@ -62,7 +64,7 @@ func TestWithReplicator(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -100,7 +102,8 @@ func TestWithReplicator(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -121,7 +124,7 @@ func TestWithReplicator(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -129,7 +132,7 @@ func TestWithReplicator(t *testing.T) { got := WithReplicator(test.args.ctrl) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/manager/replication/controller/handler/rest/handler_test.go b/pkg/manager/replication/controller/handler/rest/handler_test.go index 7c77fe4ede..4cbbde227e 100644 --- a/pkg/manager/replication/controller/handler/rest/handler_test.go +++ b/pkg/manager/replication/controller/handler/rest/handler_test.go @@ -28,6 +28,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -78,7 +79,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -99,6 +101,7 @@ func TestNew(t *testing.T) { } func Test_handler_Index(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -166,7 +169,8 @@ func Test_handler_Index(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/manager/replication/controller/handler/rest/option_test.go b/pkg/manager/replication/controller/handler/rest/option_test.go index b76bfe7705..5c03ee4334 100644 --- a/pkg/manager/replication/controller/handler/rest/option_test.go +++ b/pkg/manager/replication/controller/handler/rest/option_test.go @@ -25,6 +25,8 @@ import ( ) func TestWithReplicator(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { rpl controller.ReplicationServer @@ -62,7 +64,7 @@ func TestWithReplicator(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -100,7 +102,8 @@ func TestWithReplicator(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -121,7 +124,7 @@ func TestWithReplicator(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -129,7 +132,7 @@ func TestWithReplicator(t *testing.T) { got := WithReplicator(test.args.rpl) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/manager/replication/controller/router/option_test.go b/pkg/manager/replication/controller/router/option_test.go index 17dfd5bcc3..1b4663c476 100644 --- a/pkg/manager/replication/controller/router/option_test.go +++ b/pkg/manager/replication/controller/router/option_test.go @@ -26,6 +26,8 @@ import ( ) func TestWithHandler(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { h rest.Handler @@ -63,7 +65,7 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -101,7 +103,8 @@ func TestWithHandler(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -122,7 +125,7 @@ func TestWithHandler(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -130,7 +133,7 @@ func TestWithHandler(t *testing.T) { got := WithHandler(test.args.h) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -139,6 +142,8 @@ func TestWithHandler(t *testing.T) { } func TestWithTimeout(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { timeout string @@ -176,7 +181,7 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -214,7 +219,8 @@ func TestWithTimeout(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -235,7 +241,7 @@ func TestWithTimeout(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -243,7 +249,7 @@ func TestWithTimeout(t *testing.T) { got := WithTimeout(test.args.timeout) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -252,6 +258,8 @@ func TestWithTimeout(t *testing.T) { } func TestWithErrGroup(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { eg errgroup.Group @@ -289,7 +297,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -327,7 +335,8 @@ func TestWithErrGroup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -348,7 +357,7 @@ func TestWithErrGroup(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -356,7 +365,7 @@ func TestWithErrGroup(t *testing.T) { got := WithErrGroup(test.args.eg) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/manager/replication/controller/router/router_test.go b/pkg/manager/replication/controller/router/router_test.go index 7be666ccd5..ec7ce94494 100644 --- a/pkg/manager/replication/controller/router/router_test.go +++ b/pkg/manager/replication/controller/router/router_test.go @@ -27,6 +27,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -77,7 +78,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/manager/replication/controller/service/discover_test.go b/pkg/manager/replication/controller/service/discover_test.go index a4b3aa483e..cb1592b34b 100644 --- a/pkg/manager/replication/controller/service/discover_test.go +++ b/pkg/manager/replication/controller/service/discover_test.go @@ -33,6 +33,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -87,7 +88,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -108,6 +110,7 @@ func TestNew(t *testing.T) { } func Test_replicator_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -193,7 +196,8 @@ func Test_replicator_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -224,6 +228,7 @@ func Test_replicator_Start(t *testing.T) { } func Test_replicator_GetCurrentPodIPs(t *testing.T) { + t.Parallel() type fields struct { pods atomic.Value ctrl k8s.Controller @@ -299,7 +304,8 @@ func Test_replicator_GetCurrentPodIPs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -330,6 +336,7 @@ func Test_replicator_GetCurrentPodIPs(t *testing.T) { } func Test_replicator_SendRecoveryRequest(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -411,7 +418,8 @@ func Test_replicator_SendRecoveryRequest(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/manager/replication/controller/service/nodemap_test.go b/pkg/manager/replication/controller/service/nodemap_test.go index 54290f1cab..4ffe7a1eed 100644 --- a/pkg/manager/replication/controller/service/nodemap_test.go +++ b/pkg/manager/replication/controller/service/nodemap_test.go @@ -29,6 +29,7 @@ import ( ) func Test_newEntryNodeMap(t *testing.T) { + t.Parallel() type args struct { i node.Node } @@ -79,7 +80,8 @@ func Test_newEntryNodeMap(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -100,6 +102,7 @@ func Test_newEntryNodeMap(t *testing.T) { } func Test_nodeMap_Load(t *testing.T) { + t.Parallel() type args struct { key string } @@ -173,7 +176,8 @@ func Test_nodeMap_Load(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -200,6 +204,7 @@ func Test_nodeMap_Load(t *testing.T) { } func Test_entryNodeMap_load(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -254,7 +259,8 @@ func Test_entryNodeMap_load(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -278,6 +284,7 @@ func Test_entryNodeMap_load(t *testing.T) { } func Test_nodeMap_Store(t *testing.T) { + t.Parallel() type args struct { key string value node.Node @@ -346,7 +353,8 @@ func Test_nodeMap_Store(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -372,6 +380,7 @@ func Test_nodeMap_Store(t *testing.T) { } func Test_entryNodeMap_tryStore(t *testing.T) { + t.Parallel() type args struct { i *node.Node } @@ -432,7 +441,8 @@ func Test_entryNodeMap_tryStore(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -456,6 +466,7 @@ func Test_entryNodeMap_tryStore(t *testing.T) { } func Test_entryNodeMap_unexpungeLocked(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -506,7 +517,8 @@ func Test_entryNodeMap_unexpungeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -530,6 +542,7 @@ func Test_entryNodeMap_unexpungeLocked(t *testing.T) { } func Test_entryNodeMap_storeLocked(t *testing.T) { + t.Parallel() type args struct { i *node.Node } @@ -586,7 +599,8 @@ func Test_entryNodeMap_storeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -609,6 +623,7 @@ func Test_entryNodeMap_storeLocked(t *testing.T) { } func Test_nodeMap_LoadOrStore(t *testing.T) { + t.Parallel() type args struct { key string value node.Node @@ -685,7 +700,8 @@ func Test_nodeMap_LoadOrStore(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -712,6 +728,7 @@ func Test_nodeMap_LoadOrStore(t *testing.T) { } func Test_entryNodeMap_tryLoadOrStore(t *testing.T) { + t.Parallel() type args struct { i node.Node } @@ -780,7 +797,8 @@ func Test_entryNodeMap_tryLoadOrStore(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -804,6 +822,7 @@ func Test_entryNodeMap_tryLoadOrStore(t *testing.T) { } func Test_nodeMap_Delete(t *testing.T) { + t.Parallel() type args struct { key string } @@ -869,7 +888,8 @@ func Test_nodeMap_Delete(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -895,6 +915,7 @@ func Test_nodeMap_Delete(t *testing.T) { } func Test_entryNodeMap_delete(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -945,7 +966,8 @@ func Test_entryNodeMap_delete(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -969,6 +991,7 @@ func Test_entryNodeMap_delete(t *testing.T) { } func Test_nodeMap_Range(t *testing.T) { + t.Parallel() type args struct { f func(key string, value node.Node) bool } @@ -1034,7 +1057,8 @@ func Test_nodeMap_Range(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1060,6 +1084,7 @@ func Test_nodeMap_Range(t *testing.T) { } func Test_nodeMap_missLocked(t *testing.T) { + t.Parallel() type fields struct { mu sync.Mutex read atomic.Value @@ -1115,7 +1140,8 @@ func Test_nodeMap_missLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -1141,6 +1167,7 @@ func Test_nodeMap_missLocked(t *testing.T) { } func Test_nodeMap_dirtyLocked(t *testing.T) { + t.Parallel() type fields struct { mu sync.Mutex read atomic.Value @@ -1196,7 +1223,8 @@ func Test_nodeMap_dirtyLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -1222,6 +1250,7 @@ func Test_nodeMap_dirtyLocked(t *testing.T) { } func Test_entryNodeMap_tryExpungeLocked(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -1272,7 +1301,8 @@ func Test_entryNodeMap_tryExpungeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } diff --git a/pkg/manager/replication/controller/service/nodemetricsmap_test.go b/pkg/manager/replication/controller/service/nodemetricsmap_test.go index 94cde93f71..75f0ff156c 100644 --- a/pkg/manager/replication/controller/service/nodemetricsmap_test.go +++ b/pkg/manager/replication/controller/service/nodemetricsmap_test.go @@ -29,6 +29,7 @@ import ( ) func Test_newEntryNodeMetricsMap(t *testing.T) { + t.Parallel() type args struct { i mnode.Node } @@ -79,7 +80,8 @@ func Test_newEntryNodeMetricsMap(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -100,6 +102,7 @@ func Test_newEntryNodeMetricsMap(t *testing.T) { } func Test_nodeMetricsMap_Load(t *testing.T) { + t.Parallel() type args struct { key string } @@ -173,7 +176,8 @@ func Test_nodeMetricsMap_Load(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -200,6 +204,7 @@ func Test_nodeMetricsMap_Load(t *testing.T) { } func Test_entryNodeMetricsMap_load(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -254,7 +259,8 @@ func Test_entryNodeMetricsMap_load(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -278,6 +284,7 @@ func Test_entryNodeMetricsMap_load(t *testing.T) { } func Test_nodeMetricsMap_Store(t *testing.T) { + t.Parallel() type args struct { key string value mnode.Node @@ -346,7 +353,8 @@ func Test_nodeMetricsMap_Store(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -372,6 +380,7 @@ func Test_nodeMetricsMap_Store(t *testing.T) { } func Test_entryNodeMetricsMap_tryStore(t *testing.T) { + t.Parallel() type args struct { i *mnode.Node } @@ -432,7 +441,8 @@ func Test_entryNodeMetricsMap_tryStore(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -456,6 +466,7 @@ func Test_entryNodeMetricsMap_tryStore(t *testing.T) { } func Test_entryNodeMetricsMap_unexpungeLocked(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -506,7 +517,8 @@ func Test_entryNodeMetricsMap_unexpungeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -530,6 +542,7 @@ func Test_entryNodeMetricsMap_unexpungeLocked(t *testing.T) { } func Test_entryNodeMetricsMap_storeLocked(t *testing.T) { + t.Parallel() type args struct { i *mnode.Node } @@ -586,7 +599,8 @@ func Test_entryNodeMetricsMap_storeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -609,6 +623,7 @@ func Test_entryNodeMetricsMap_storeLocked(t *testing.T) { } func Test_nodeMetricsMap_LoadOrStore(t *testing.T) { + t.Parallel() type args struct { key string value mnode.Node @@ -685,7 +700,8 @@ func Test_nodeMetricsMap_LoadOrStore(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -712,6 +728,7 @@ func Test_nodeMetricsMap_LoadOrStore(t *testing.T) { } func Test_entryNodeMetricsMap_tryLoadOrStore(t *testing.T) { + t.Parallel() type args struct { i mnode.Node } @@ -780,7 +797,8 @@ func Test_entryNodeMetricsMap_tryLoadOrStore(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -804,6 +822,7 @@ func Test_entryNodeMetricsMap_tryLoadOrStore(t *testing.T) { } func Test_nodeMetricsMap_Delete(t *testing.T) { + t.Parallel() type args struct { key string } @@ -869,7 +888,8 @@ func Test_nodeMetricsMap_Delete(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -895,6 +915,7 @@ func Test_nodeMetricsMap_Delete(t *testing.T) { } func Test_entryNodeMetricsMap_delete(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -945,7 +966,8 @@ func Test_entryNodeMetricsMap_delete(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -969,6 +991,7 @@ func Test_entryNodeMetricsMap_delete(t *testing.T) { } func Test_nodeMetricsMap_Range(t *testing.T) { + t.Parallel() type args struct { f func(key string, value mnode.Node) bool } @@ -1034,7 +1057,8 @@ func Test_nodeMetricsMap_Range(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1060,6 +1084,7 @@ func Test_nodeMetricsMap_Range(t *testing.T) { } func Test_nodeMetricsMap_missLocked(t *testing.T) { + t.Parallel() type fields struct { mu sync.Mutex read atomic.Value @@ -1115,7 +1140,8 @@ func Test_nodeMetricsMap_missLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -1141,6 +1167,7 @@ func Test_nodeMetricsMap_missLocked(t *testing.T) { } func Test_nodeMetricsMap_dirtyLocked(t *testing.T) { + t.Parallel() type fields struct { mu sync.Mutex read atomic.Value @@ -1196,7 +1223,8 @@ func Test_nodeMetricsMap_dirtyLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -1222,6 +1250,7 @@ func Test_nodeMetricsMap_dirtyLocked(t *testing.T) { } func Test_entryNodeMetricsMap_tryExpungeLocked(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -1272,7 +1301,8 @@ func Test_entryNodeMetricsMap_tryExpungeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } diff --git a/pkg/manager/replication/controller/service/option_test.go b/pkg/manager/replication/controller/service/option_test.go index 58bf35732a..ddebdce659 100644 --- a/pkg/manager/replication/controller/service/option_test.go +++ b/pkg/manager/replication/controller/service/option_test.go @@ -25,6 +25,8 @@ import ( ) func TestWithName(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { name string @@ -62,7 +64,7 @@ func TestWithName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -100,7 +102,8 @@ func TestWithName(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -121,7 +124,7 @@ func TestWithName(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -129,7 +132,7 @@ func TestWithName(t *testing.T) { got := WithName(test.args.name) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -138,6 +141,8 @@ func TestWithName(t *testing.T) { } func TestWithNamespace(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { ns string @@ -175,7 +180,7 @@ func TestWithNamespace(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -213,7 +218,8 @@ func TestWithNamespace(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -234,7 +240,7 @@ func TestWithNamespace(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -242,7 +248,7 @@ func TestWithNamespace(t *testing.T) { got := WithNamespace(test.args.ns) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -251,6 +257,8 @@ func TestWithNamespace(t *testing.T) { } func TestWithRecoverCheckDuration(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { dur string @@ -288,7 +296,7 @@ func TestWithRecoverCheckDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -326,7 +334,8 @@ func TestWithRecoverCheckDuration(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -347,7 +356,7 @@ func TestWithRecoverCheckDuration(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -355,7 +364,7 @@ func TestWithRecoverCheckDuration(t *testing.T) { got := WithRecoverCheckDuration(test.args.dur) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -364,6 +373,8 @@ func TestWithRecoverCheckDuration(t *testing.T) { } func TestWithErrGroup(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { eg errgroup.Group @@ -401,7 +412,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -439,7 +450,8 @@ func TestWithErrGroup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -460,7 +472,7 @@ func TestWithErrGroup(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -468,7 +480,7 @@ func TestWithErrGroup(t *testing.T) { got := WithErrGroup(test.args.eg) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/manager/replication/controller/service/podmetricsmap_test.go b/pkg/manager/replication/controller/service/podmetricsmap_test.go index 25bfe6bc48..cb47898e26 100644 --- a/pkg/manager/replication/controller/service/podmetricsmap_test.go +++ b/pkg/manager/replication/controller/service/podmetricsmap_test.go @@ -29,6 +29,7 @@ import ( ) func Test_newEntryPodMetricsMap(t *testing.T) { + t.Parallel() type args struct { i mpod.Pod } @@ -79,7 +80,8 @@ func Test_newEntryPodMetricsMap(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -100,6 +102,7 @@ func Test_newEntryPodMetricsMap(t *testing.T) { } func Test_podMetricsMap_Load(t *testing.T) { + t.Parallel() type args struct { key string } @@ -173,7 +176,8 @@ func Test_podMetricsMap_Load(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -200,6 +204,7 @@ func Test_podMetricsMap_Load(t *testing.T) { } func Test_entryPodMetricsMap_load(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -254,7 +259,8 @@ func Test_entryPodMetricsMap_load(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -278,6 +284,7 @@ func Test_entryPodMetricsMap_load(t *testing.T) { } func Test_podMetricsMap_Store(t *testing.T) { + t.Parallel() type args struct { key string value mpod.Pod @@ -346,7 +353,8 @@ func Test_podMetricsMap_Store(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -372,6 +380,7 @@ func Test_podMetricsMap_Store(t *testing.T) { } func Test_entryPodMetricsMap_tryStore(t *testing.T) { + t.Parallel() type args struct { i *mpod.Pod } @@ -432,7 +441,8 @@ func Test_entryPodMetricsMap_tryStore(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -456,6 +466,7 @@ func Test_entryPodMetricsMap_tryStore(t *testing.T) { } func Test_entryPodMetricsMap_unexpungeLocked(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -506,7 +517,8 @@ func Test_entryPodMetricsMap_unexpungeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -530,6 +542,7 @@ func Test_entryPodMetricsMap_unexpungeLocked(t *testing.T) { } func Test_entryPodMetricsMap_storeLocked(t *testing.T) { + t.Parallel() type args struct { i *mpod.Pod } @@ -586,7 +599,8 @@ func Test_entryPodMetricsMap_storeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -609,6 +623,7 @@ func Test_entryPodMetricsMap_storeLocked(t *testing.T) { } func Test_podMetricsMap_LoadOrStore(t *testing.T) { + t.Parallel() type args struct { key string value mpod.Pod @@ -685,7 +700,8 @@ func Test_podMetricsMap_LoadOrStore(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -712,6 +728,7 @@ func Test_podMetricsMap_LoadOrStore(t *testing.T) { } func Test_entryPodMetricsMap_tryLoadOrStore(t *testing.T) { + t.Parallel() type args struct { i mpod.Pod } @@ -780,7 +797,8 @@ func Test_entryPodMetricsMap_tryLoadOrStore(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -804,6 +822,7 @@ func Test_entryPodMetricsMap_tryLoadOrStore(t *testing.T) { } func Test_podMetricsMap_Delete(t *testing.T) { + t.Parallel() type args struct { key string } @@ -869,7 +888,8 @@ func Test_podMetricsMap_Delete(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -895,6 +915,7 @@ func Test_podMetricsMap_Delete(t *testing.T) { } func Test_entryPodMetricsMap_delete(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -945,7 +966,8 @@ func Test_entryPodMetricsMap_delete(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -969,6 +991,7 @@ func Test_entryPodMetricsMap_delete(t *testing.T) { } func Test_podMetricsMap_Range(t *testing.T) { + t.Parallel() type args struct { f func(key string, value mpod.Pod) bool } @@ -1034,7 +1057,8 @@ func Test_podMetricsMap_Range(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1060,6 +1084,7 @@ func Test_podMetricsMap_Range(t *testing.T) { } func Test_podMetricsMap_missLocked(t *testing.T) { + t.Parallel() type fields struct { mu sync.Mutex read atomic.Value @@ -1115,7 +1140,8 @@ func Test_podMetricsMap_missLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -1141,6 +1167,7 @@ func Test_podMetricsMap_missLocked(t *testing.T) { } func Test_podMetricsMap_dirtyLocked(t *testing.T) { + t.Parallel() type fields struct { mu sync.Mutex read atomic.Value @@ -1196,7 +1223,8 @@ func Test_podMetricsMap_dirtyLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -1222,6 +1250,7 @@ func Test_podMetricsMap_dirtyLocked(t *testing.T) { } func Test_entryPodMetricsMap_tryExpungeLocked(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -1272,7 +1301,8 @@ func Test_entryPodMetricsMap_tryExpungeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } diff --git a/pkg/manager/replication/controller/service/podsmap_test.go b/pkg/manager/replication/controller/service/podsmap_test.go index c6ce89f74b..5203809d3d 100644 --- a/pkg/manager/replication/controller/service/podsmap_test.go +++ b/pkg/manager/replication/controller/service/podsmap_test.go @@ -29,6 +29,7 @@ import ( ) func Test_newEntryPodsMap(t *testing.T) { + t.Parallel() type args struct { i []pod.Pod } @@ -79,7 +80,8 @@ func Test_newEntryPodsMap(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -100,6 +102,7 @@ func Test_newEntryPodsMap(t *testing.T) { } func Test_podsMap_Load(t *testing.T) { + t.Parallel() type args struct { key string } @@ -173,7 +176,8 @@ func Test_podsMap_Load(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -200,6 +204,7 @@ func Test_podsMap_Load(t *testing.T) { } func Test_entryPodsMap_load(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -254,7 +259,8 @@ func Test_entryPodsMap_load(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -278,6 +284,7 @@ func Test_entryPodsMap_load(t *testing.T) { } func Test_podsMap_Store(t *testing.T) { + t.Parallel() type args struct { key string value []pod.Pod @@ -346,7 +353,8 @@ func Test_podsMap_Store(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -372,6 +380,7 @@ func Test_podsMap_Store(t *testing.T) { } func Test_entryPodsMap_tryStore(t *testing.T) { + t.Parallel() type args struct { i *[]pod.Pod } @@ -432,7 +441,8 @@ func Test_entryPodsMap_tryStore(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -456,6 +466,7 @@ func Test_entryPodsMap_tryStore(t *testing.T) { } func Test_entryPodsMap_unexpungeLocked(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -506,7 +517,8 @@ func Test_entryPodsMap_unexpungeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -530,6 +542,7 @@ func Test_entryPodsMap_unexpungeLocked(t *testing.T) { } func Test_entryPodsMap_storeLocked(t *testing.T) { + t.Parallel() type args struct { i *[]pod.Pod } @@ -586,7 +599,8 @@ func Test_entryPodsMap_storeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -609,6 +623,7 @@ func Test_entryPodsMap_storeLocked(t *testing.T) { } func Test_podsMap_LoadOrStore(t *testing.T) { + t.Parallel() type args struct { key string value []pod.Pod @@ -685,7 +700,8 @@ func Test_podsMap_LoadOrStore(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -712,6 +728,7 @@ func Test_podsMap_LoadOrStore(t *testing.T) { } func Test_entryPodsMap_tryLoadOrStore(t *testing.T) { + t.Parallel() type args struct { i []pod.Pod } @@ -780,7 +797,8 @@ func Test_entryPodsMap_tryLoadOrStore(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -804,6 +822,7 @@ func Test_entryPodsMap_tryLoadOrStore(t *testing.T) { } func Test_podsMap_Delete(t *testing.T) { + t.Parallel() type args struct { key string } @@ -869,7 +888,8 @@ func Test_podsMap_Delete(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -895,6 +915,7 @@ func Test_podsMap_Delete(t *testing.T) { } func Test_entryPodsMap_delete(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -945,7 +966,8 @@ func Test_entryPodsMap_delete(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -969,6 +991,7 @@ func Test_entryPodsMap_delete(t *testing.T) { } func Test_podsMap_Range(t *testing.T) { + t.Parallel() type args struct { f func(key string, value []pod.Pod) bool } @@ -1034,7 +1057,8 @@ func Test_podsMap_Range(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1060,6 +1084,7 @@ func Test_podsMap_Range(t *testing.T) { } func Test_podsMap_missLocked(t *testing.T) { + t.Parallel() type fields struct { mu sync.Mutex read atomic.Value @@ -1115,7 +1140,8 @@ func Test_podsMap_missLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -1141,6 +1167,7 @@ func Test_podsMap_missLocked(t *testing.T) { } func Test_podsMap_dirtyLocked(t *testing.T) { + t.Parallel() type fields struct { mu sync.Mutex read atomic.Value @@ -1196,7 +1223,8 @@ func Test_podsMap_dirtyLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -1222,6 +1250,7 @@ func Test_podsMap_dirtyLocked(t *testing.T) { } func Test_entryPodsMap_tryExpungeLocked(t *testing.T) { + t.Parallel() type fields struct { p unsafe.Pointer } @@ -1272,7 +1301,8 @@ func Test_entryPodsMap_tryExpungeLocked(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } diff --git a/pkg/manager/replication/controller/usecase/discovered_test.go b/pkg/manager/replication/controller/usecase/discovered_test.go index 573ede8f70..1584d3eeb5 100644 --- a/pkg/manager/replication/controller/usecase/discovered_test.go +++ b/pkg/manager/replication/controller/usecase/discovered_test.go @@ -32,6 +32,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { cfg *config.Data } @@ -86,7 +87,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -107,6 +109,7 @@ func TestNew(t *testing.T) { } func Test_run_PreStart(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -179,7 +182,8 @@ func Test_run_PreStart(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -207,6 +211,7 @@ func Test_run_PreStart(t *testing.T) { } func Test_run_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -283,7 +288,8 @@ func Test_run_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -311,6 +317,7 @@ func Test_run_Start(t *testing.T) { } func Test_run_PreStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -383,7 +390,8 @@ func Test_run_PreStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -411,6 +419,7 @@ func Test_run_PreStop(t *testing.T) { } func Test_run_Stop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -483,7 +492,8 @@ func Test_run_Stop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -511,6 +521,7 @@ func Test_run_Stop(t *testing.T) { } func Test_run_PostStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -583,7 +594,8 @@ func Test_run_PostStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/meta/cassandra/config/config_test.go b/pkg/meta/cassandra/config/config_test.go index e8090717ea..9a2a62be78 100644 --- a/pkg/meta/cassandra/config/config_test.go +++ b/pkg/meta/cassandra/config/config_test.go @@ -26,6 +26,7 @@ import ( ) func TestNewConfig(t *testing.T) { + t.Parallel() type args struct { path string } @@ -80,7 +81,8 @@ func TestNewConfig(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/meta/cassandra/handler/grpc/handler_test.go b/pkg/meta/cassandra/handler/grpc/handler_test.go index fc499d2485..69c7a838d1 100644 --- a/pkg/meta/cassandra/handler/grpc/handler_test.go +++ b/pkg/meta/cassandra/handler/grpc/handler_test.go @@ -30,6 +30,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -80,7 +81,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -101,6 +103,7 @@ func TestNew(t *testing.T) { } func Test_server_GetMeta(t *testing.T) { + t.Parallel() type args struct { ctx context.Context key *payload.Meta_Key @@ -168,7 +171,8 @@ func Test_server_GetMeta(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -192,6 +196,7 @@ func Test_server_GetMeta(t *testing.T) { } func Test_server_GetMetas(t *testing.T) { + t.Parallel() type args struct { ctx context.Context keys *payload.Meta_Keys @@ -259,7 +264,8 @@ func Test_server_GetMetas(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -283,6 +289,7 @@ func Test_server_GetMetas(t *testing.T) { } func Test_server_GetMetaInverse(t *testing.T) { + t.Parallel() type args struct { ctx context.Context val *payload.Meta_Val @@ -350,7 +357,8 @@ func Test_server_GetMetaInverse(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -374,6 +382,7 @@ func Test_server_GetMetaInverse(t *testing.T) { } func Test_server_GetMetasInverse(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vals *payload.Meta_Vals @@ -441,7 +450,8 @@ func Test_server_GetMetasInverse(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -465,6 +475,7 @@ func Test_server_GetMetasInverse(t *testing.T) { } func Test_server_SetMeta(t *testing.T) { + t.Parallel() type args struct { ctx context.Context kv *payload.Meta_KeyVal @@ -532,7 +543,8 @@ func Test_server_SetMeta(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -556,6 +568,7 @@ func Test_server_SetMeta(t *testing.T) { } func Test_server_SetMetas(t *testing.T) { + t.Parallel() type args struct { ctx context.Context kvs *payload.Meta_KeyVals @@ -623,7 +636,8 @@ func Test_server_SetMetas(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -647,6 +661,7 @@ func Test_server_SetMetas(t *testing.T) { } func Test_server_DeleteMeta(t *testing.T) { + t.Parallel() type args struct { ctx context.Context key *payload.Meta_Key @@ -714,7 +729,8 @@ func Test_server_DeleteMeta(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -738,6 +754,7 @@ func Test_server_DeleteMeta(t *testing.T) { } func Test_server_DeleteMetas(t *testing.T) { + t.Parallel() type args struct { ctx context.Context keys *payload.Meta_Keys @@ -805,7 +822,8 @@ func Test_server_DeleteMetas(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -829,6 +847,7 @@ func Test_server_DeleteMetas(t *testing.T) { } func Test_server_DeleteMetaInverse(t *testing.T) { + t.Parallel() type args struct { ctx context.Context val *payload.Meta_Val @@ -896,7 +915,8 @@ func Test_server_DeleteMetaInverse(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -920,6 +940,7 @@ func Test_server_DeleteMetaInverse(t *testing.T) { } func Test_server_DeleteMetasInverse(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vals *payload.Meta_Vals @@ -987,7 +1008,8 @@ func Test_server_DeleteMetasInverse(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/meta/cassandra/handler/grpc/option_test.go b/pkg/meta/cassandra/handler/grpc/option_test.go index 139ba16b91..91ae9910cd 100644 --- a/pkg/meta/cassandra/handler/grpc/option_test.go +++ b/pkg/meta/cassandra/handler/grpc/option_test.go @@ -25,6 +25,8 @@ import ( ) func TestWithCassandra(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { r service.Cassandra @@ -62,7 +64,7 @@ func TestWithCassandra(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -100,7 +102,8 @@ func TestWithCassandra(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -121,7 +124,7 @@ func TestWithCassandra(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -129,7 +132,7 @@ func TestWithCassandra(t *testing.T) { got := WithCassandra(test.args.r) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/meta/cassandra/handler/rest/handler_test.go b/pkg/meta/cassandra/handler/rest/handler_test.go index 11a968dc9a..b49afed62b 100644 --- a/pkg/meta/cassandra/handler/rest/handler_test.go +++ b/pkg/meta/cassandra/handler/rest/handler_test.go @@ -28,6 +28,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -78,7 +79,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -99,6 +101,7 @@ func TestNew(t *testing.T) { } func Test_handler_Index(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -166,7 +169,8 @@ func Test_handler_Index(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -190,6 +194,7 @@ func Test_handler_Index(t *testing.T) { } func Test_handler_GetMeta(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -257,7 +262,8 @@ func Test_handler_GetMeta(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -281,6 +287,7 @@ func Test_handler_GetMeta(t *testing.T) { } func Test_handler_GetMetas(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -348,7 +355,8 @@ func Test_handler_GetMetas(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -372,6 +380,7 @@ func Test_handler_GetMetas(t *testing.T) { } func Test_handler_GetMetaInverse(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -439,7 +448,8 @@ func Test_handler_GetMetaInverse(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -463,6 +473,7 @@ func Test_handler_GetMetaInverse(t *testing.T) { } func Test_handler_GetMetasInverse(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -530,7 +541,8 @@ func Test_handler_GetMetasInverse(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -554,6 +566,7 @@ func Test_handler_GetMetasInverse(t *testing.T) { } func Test_handler_SetMeta(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -621,7 +634,8 @@ func Test_handler_SetMeta(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -645,6 +659,7 @@ func Test_handler_SetMeta(t *testing.T) { } func Test_handler_SetMetas(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -712,7 +727,8 @@ func Test_handler_SetMetas(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -736,6 +752,7 @@ func Test_handler_SetMetas(t *testing.T) { } func Test_handler_DeleteMeta(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -803,7 +820,8 @@ func Test_handler_DeleteMeta(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -827,6 +845,7 @@ func Test_handler_DeleteMeta(t *testing.T) { } func Test_handler_DeleteMetas(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -894,7 +913,8 @@ func Test_handler_DeleteMetas(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -918,6 +938,7 @@ func Test_handler_DeleteMetas(t *testing.T) { } func Test_handler_DeleteMetaInverse(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -985,7 +1006,8 @@ func Test_handler_DeleteMetaInverse(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1009,6 +1031,7 @@ func Test_handler_DeleteMetaInverse(t *testing.T) { } func Test_handler_DeleteMetasInverse(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -1076,7 +1099,8 @@ func Test_handler_DeleteMetasInverse(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/meta/cassandra/handler/rest/option_test.go b/pkg/meta/cassandra/handler/rest/option_test.go index 9ebfc2adc9..c737293a91 100644 --- a/pkg/meta/cassandra/handler/rest/option_test.go +++ b/pkg/meta/cassandra/handler/rest/option_test.go @@ -25,6 +25,8 @@ import ( ) func TestWithMeta(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { m meta.MetaServer @@ -62,7 +64,7 @@ func TestWithMeta(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -100,7 +102,8 @@ func TestWithMeta(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -121,7 +124,7 @@ func TestWithMeta(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -129,7 +132,7 @@ func TestWithMeta(t *testing.T) { got := WithMeta(test.args.m) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/meta/cassandra/router/option_test.go b/pkg/meta/cassandra/router/option_test.go index 5964254237..0b3455f8e3 100644 --- a/pkg/meta/cassandra/router/option_test.go +++ b/pkg/meta/cassandra/router/option_test.go @@ -26,6 +26,8 @@ import ( ) func TestWithHandler(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { h rest.Handler @@ -63,7 +65,7 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -101,7 +103,8 @@ func TestWithHandler(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -122,7 +125,7 @@ func TestWithHandler(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -130,7 +133,7 @@ func TestWithHandler(t *testing.T) { got := WithHandler(test.args.h) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -139,6 +142,8 @@ func TestWithHandler(t *testing.T) { } func TestWithTimeout(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { timeout string @@ -176,7 +181,7 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -214,7 +219,8 @@ func TestWithTimeout(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -235,7 +241,7 @@ func TestWithTimeout(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -243,7 +249,7 @@ func TestWithTimeout(t *testing.T) { got := WithTimeout(test.args.timeout) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -252,6 +258,8 @@ func TestWithTimeout(t *testing.T) { } func TestWithErrGroup(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { eg errgroup.Group @@ -289,7 +297,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -327,7 +335,8 @@ func TestWithErrGroup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -348,7 +357,7 @@ func TestWithErrGroup(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -356,7 +365,7 @@ func TestWithErrGroup(t *testing.T) { got := WithErrGroup(test.args.eg) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/meta/cassandra/router/router_test.go b/pkg/meta/cassandra/router/router_test.go index 7be666ccd5..ec7ce94494 100644 --- a/pkg/meta/cassandra/router/router_test.go +++ b/pkg/meta/cassandra/router/router_test.go @@ -27,6 +27,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -77,7 +78,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/meta/cassandra/service/cassandra_test.go b/pkg/meta/cassandra/service/cassandra_test.go index 14804dac21..1e7e5a2685 100644 --- a/pkg/meta/cassandra/service/cassandra_test.go +++ b/pkg/meta/cassandra/service/cassandra_test.go @@ -29,6 +29,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { cfg *config.Cassandra } @@ -83,7 +84,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -104,6 +106,7 @@ func TestNew(t *testing.T) { } func Test_client_Connect(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -170,7 +173,8 @@ func Test_client_Connect(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -196,6 +200,7 @@ func Test_client_Connect(t *testing.T) { } func Test_client_Close(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -262,7 +267,8 @@ func Test_client_Close(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -288,6 +294,7 @@ func Test_client_Close(t *testing.T) { } func Test_client_Get(t *testing.T) { + t.Parallel() type args struct { key string } @@ -358,7 +365,8 @@ func Test_client_Get(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -384,6 +392,7 @@ func Test_client_Get(t *testing.T) { } func Test_client_GetMultiple(t *testing.T) { + t.Parallel() type args struct { keys []string } @@ -454,7 +463,8 @@ func Test_client_GetMultiple(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -480,6 +490,7 @@ func Test_client_GetMultiple(t *testing.T) { } func Test_client_GetInverse(t *testing.T) { + t.Parallel() type args struct { val string } @@ -550,7 +561,8 @@ func Test_client_GetInverse(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -576,6 +588,7 @@ func Test_client_GetInverse(t *testing.T) { } func Test_client_GetInverseMultiple(t *testing.T) { + t.Parallel() type args struct { vals []string } @@ -646,7 +659,8 @@ func Test_client_GetInverseMultiple(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -672,6 +686,7 @@ func Test_client_GetInverseMultiple(t *testing.T) { } func Test_client_Set(t *testing.T) { + t.Parallel() type args struct { key string val string @@ -741,7 +756,8 @@ func Test_client_Set(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -767,6 +783,7 @@ func Test_client_Set(t *testing.T) { } func Test_client_SetMultiple(t *testing.T) { + t.Parallel() type args struct { kvs map[string]string } @@ -833,7 +850,8 @@ func Test_client_SetMultiple(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -859,6 +877,7 @@ func Test_client_SetMultiple(t *testing.T) { } func Test_client_deleteByKeys(t *testing.T) { + t.Parallel() type args struct { keys []string } @@ -929,7 +948,8 @@ func Test_client_deleteByKeys(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -955,6 +975,7 @@ func Test_client_deleteByKeys(t *testing.T) { } func Test_client_Delete(t *testing.T) { + t.Parallel() type args struct { key string } @@ -1025,7 +1046,8 @@ func Test_client_Delete(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1051,6 +1073,7 @@ func Test_client_Delete(t *testing.T) { } func Test_client_DeleteMultiple(t *testing.T) { + t.Parallel() type args struct { keys []string } @@ -1121,7 +1144,8 @@ func Test_client_DeleteMultiple(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1147,6 +1171,7 @@ func Test_client_DeleteMultiple(t *testing.T) { } func Test_client_deleteByValues(t *testing.T) { + t.Parallel() type args struct { vals []string } @@ -1217,7 +1242,8 @@ func Test_client_deleteByValues(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1243,6 +1269,7 @@ func Test_client_deleteByValues(t *testing.T) { } func Test_client_DeleteInverse(t *testing.T) { + t.Parallel() type args struct { val string } @@ -1313,7 +1340,8 @@ func Test_client_DeleteInverse(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1339,6 +1367,7 @@ func Test_client_DeleteInverse(t *testing.T) { } func Test_client_DeleteInverseMultiple(t *testing.T) { + t.Parallel() type args struct { vals []string } @@ -1409,7 +1438,8 @@ func Test_client_DeleteInverseMultiple(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/meta/cassandra/usecase/meta_test.go b/pkg/meta/cassandra/usecase/meta_test.go index df58c9e21b..be6af436c9 100644 --- a/pkg/meta/cassandra/usecase/meta_test.go +++ b/pkg/meta/cassandra/usecase/meta_test.go @@ -32,6 +32,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { cfg *config.Data } @@ -86,7 +87,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -107,6 +109,7 @@ func TestNew(t *testing.T) { } func Test_run_PreStart(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -179,7 +182,8 @@ func Test_run_PreStart(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -207,6 +211,7 @@ func Test_run_PreStart(t *testing.T) { } func Test_run_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -283,7 +288,8 @@ func Test_run_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -311,6 +317,7 @@ func Test_run_Start(t *testing.T) { } func Test_run_PreStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -383,7 +390,8 @@ func Test_run_PreStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -411,6 +419,7 @@ func Test_run_PreStop(t *testing.T) { } func Test_run_Stop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -483,7 +492,8 @@ func Test_run_Stop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -511,6 +521,7 @@ func Test_run_Stop(t *testing.T) { } func Test_run_PostStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -583,7 +594,8 @@ func Test_run_PostStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/meta/redis/config/config_test.go b/pkg/meta/redis/config/config_test.go index e8090717ea..9a2a62be78 100644 --- a/pkg/meta/redis/config/config_test.go +++ b/pkg/meta/redis/config/config_test.go @@ -26,6 +26,7 @@ import ( ) func TestNewConfig(t *testing.T) { + t.Parallel() type args struct { path string } @@ -80,7 +81,8 @@ func TestNewConfig(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/meta/redis/handler/grpc/handler_test.go b/pkg/meta/redis/handler/grpc/handler_test.go index 0420d28515..c91bf089fc 100644 --- a/pkg/meta/redis/handler/grpc/handler_test.go +++ b/pkg/meta/redis/handler/grpc/handler_test.go @@ -30,6 +30,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -80,7 +81,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -101,6 +103,7 @@ func TestNew(t *testing.T) { } func Test_server_GetMeta(t *testing.T) { + t.Parallel() type args struct { ctx context.Context key *payload.Meta_Key @@ -168,7 +171,8 @@ func Test_server_GetMeta(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -192,6 +196,7 @@ func Test_server_GetMeta(t *testing.T) { } func Test_server_GetMetas(t *testing.T) { + t.Parallel() type args struct { ctx context.Context keys *payload.Meta_Keys @@ -259,7 +264,8 @@ func Test_server_GetMetas(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -283,6 +289,7 @@ func Test_server_GetMetas(t *testing.T) { } func Test_server_GetMetaInverse(t *testing.T) { + t.Parallel() type args struct { ctx context.Context val *payload.Meta_Val @@ -350,7 +357,8 @@ func Test_server_GetMetaInverse(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -374,6 +382,7 @@ func Test_server_GetMetaInverse(t *testing.T) { } func Test_server_GetMetasInverse(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vals *payload.Meta_Vals @@ -441,7 +450,8 @@ func Test_server_GetMetasInverse(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -465,6 +475,7 @@ func Test_server_GetMetasInverse(t *testing.T) { } func Test_server_SetMeta(t *testing.T) { + t.Parallel() type args struct { ctx context.Context kv *payload.Meta_KeyVal @@ -532,7 +543,8 @@ func Test_server_SetMeta(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -556,6 +568,7 @@ func Test_server_SetMeta(t *testing.T) { } func Test_server_SetMetas(t *testing.T) { + t.Parallel() type args struct { ctx context.Context kvs *payload.Meta_KeyVals @@ -623,7 +636,8 @@ func Test_server_SetMetas(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -647,6 +661,7 @@ func Test_server_SetMetas(t *testing.T) { } func Test_server_DeleteMeta(t *testing.T) { + t.Parallel() type args struct { ctx context.Context key *payload.Meta_Key @@ -714,7 +729,8 @@ func Test_server_DeleteMeta(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -738,6 +754,7 @@ func Test_server_DeleteMeta(t *testing.T) { } func Test_server_DeleteMetas(t *testing.T) { + t.Parallel() type args struct { ctx context.Context keys *payload.Meta_Keys @@ -805,7 +822,8 @@ func Test_server_DeleteMetas(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -829,6 +847,7 @@ func Test_server_DeleteMetas(t *testing.T) { } func Test_server_DeleteMetaInverse(t *testing.T) { + t.Parallel() type args struct { ctx context.Context val *payload.Meta_Val @@ -896,7 +915,8 @@ func Test_server_DeleteMetaInverse(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -920,6 +940,7 @@ func Test_server_DeleteMetaInverse(t *testing.T) { } func Test_server_DeleteMetasInverse(t *testing.T) { + t.Parallel() type args struct { ctx context.Context vals *payload.Meta_Vals @@ -987,7 +1008,8 @@ func Test_server_DeleteMetasInverse(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/meta/redis/handler/grpc/option_test.go b/pkg/meta/redis/handler/grpc/option_test.go index ed3cacc209..f30a6b561f 100644 --- a/pkg/meta/redis/handler/grpc/option_test.go +++ b/pkg/meta/redis/handler/grpc/option_test.go @@ -25,6 +25,8 @@ import ( ) func TestWithRedis(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { r service.Redis @@ -62,7 +64,7 @@ func TestWithRedis(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -100,7 +102,8 @@ func TestWithRedis(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -121,7 +124,7 @@ func TestWithRedis(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -129,7 +132,7 @@ func TestWithRedis(t *testing.T) { got := WithRedis(test.args.r) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/meta/redis/handler/rest/handler_test.go b/pkg/meta/redis/handler/rest/handler_test.go index 11a968dc9a..b49afed62b 100644 --- a/pkg/meta/redis/handler/rest/handler_test.go +++ b/pkg/meta/redis/handler/rest/handler_test.go @@ -28,6 +28,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -78,7 +79,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -99,6 +101,7 @@ func TestNew(t *testing.T) { } func Test_handler_Index(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -166,7 +169,8 @@ func Test_handler_Index(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -190,6 +194,7 @@ func Test_handler_Index(t *testing.T) { } func Test_handler_GetMeta(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -257,7 +262,8 @@ func Test_handler_GetMeta(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -281,6 +287,7 @@ func Test_handler_GetMeta(t *testing.T) { } func Test_handler_GetMetas(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -348,7 +355,8 @@ func Test_handler_GetMetas(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -372,6 +380,7 @@ func Test_handler_GetMetas(t *testing.T) { } func Test_handler_GetMetaInverse(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -439,7 +448,8 @@ func Test_handler_GetMetaInverse(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -463,6 +473,7 @@ func Test_handler_GetMetaInverse(t *testing.T) { } func Test_handler_GetMetasInverse(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -530,7 +541,8 @@ func Test_handler_GetMetasInverse(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -554,6 +566,7 @@ func Test_handler_GetMetasInverse(t *testing.T) { } func Test_handler_SetMeta(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -621,7 +634,8 @@ func Test_handler_SetMeta(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -645,6 +659,7 @@ func Test_handler_SetMeta(t *testing.T) { } func Test_handler_SetMetas(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -712,7 +727,8 @@ func Test_handler_SetMetas(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -736,6 +752,7 @@ func Test_handler_SetMetas(t *testing.T) { } func Test_handler_DeleteMeta(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -803,7 +820,8 @@ func Test_handler_DeleteMeta(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -827,6 +845,7 @@ func Test_handler_DeleteMeta(t *testing.T) { } func Test_handler_DeleteMetas(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -894,7 +913,8 @@ func Test_handler_DeleteMetas(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -918,6 +938,7 @@ func Test_handler_DeleteMetas(t *testing.T) { } func Test_handler_DeleteMetaInverse(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -985,7 +1006,8 @@ func Test_handler_DeleteMetaInverse(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1009,6 +1031,7 @@ func Test_handler_DeleteMetaInverse(t *testing.T) { } func Test_handler_DeleteMetasInverse(t *testing.T) { + t.Parallel() type args struct { w http.ResponseWriter r *http.Request @@ -1076,7 +1099,8 @@ func Test_handler_DeleteMetasInverse(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/meta/redis/handler/rest/option_test.go b/pkg/meta/redis/handler/rest/option_test.go index 9ebfc2adc9..c737293a91 100644 --- a/pkg/meta/redis/handler/rest/option_test.go +++ b/pkg/meta/redis/handler/rest/option_test.go @@ -25,6 +25,8 @@ import ( ) func TestWithMeta(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { m meta.MetaServer @@ -62,7 +64,7 @@ func TestWithMeta(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -100,7 +102,8 @@ func TestWithMeta(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -121,7 +124,7 @@ func TestWithMeta(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -129,7 +132,7 @@ func TestWithMeta(t *testing.T) { got := WithMeta(test.args.m) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/meta/redis/router/option_test.go b/pkg/meta/redis/router/option_test.go index 55e063cf45..11fbae91be 100644 --- a/pkg/meta/redis/router/option_test.go +++ b/pkg/meta/redis/router/option_test.go @@ -26,6 +26,8 @@ import ( ) func TestWithHandler(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { h rest.Handler @@ -63,7 +65,7 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -101,7 +103,8 @@ func TestWithHandler(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -122,7 +125,7 @@ func TestWithHandler(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -130,7 +133,7 @@ func TestWithHandler(t *testing.T) { got := WithHandler(test.args.h) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -139,6 +142,8 @@ func TestWithHandler(t *testing.T) { } func TestWithTimeout(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { timeout string @@ -176,7 +181,7 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -214,7 +219,8 @@ func TestWithTimeout(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -235,7 +241,7 @@ func TestWithTimeout(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -243,7 +249,7 @@ func TestWithTimeout(t *testing.T) { got := WithTimeout(test.args.timeout) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -252,6 +258,8 @@ func TestWithTimeout(t *testing.T) { } func TestWithErrGroup(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { eg errgroup.Group @@ -289,7 +297,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -327,7 +335,8 @@ func TestWithErrGroup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -348,7 +357,7 @@ func TestWithErrGroup(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -356,7 +365,7 @@ func TestWithErrGroup(t *testing.T) { got := WithErrGroup(test.args.eg) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/meta/redis/router/router_test.go b/pkg/meta/redis/router/router_test.go index 7be666ccd5..ec7ce94494 100644 --- a/pkg/meta/redis/router/router_test.go +++ b/pkg/meta/redis/router/router_test.go @@ -27,6 +27,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -77,7 +78,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/meta/redis/service/redis_test.go b/pkg/meta/redis/service/redis_test.go index 7fdb2faac8..e4cbe3fa23 100644 --- a/pkg/meta/redis/service/redis_test.go +++ b/pkg/meta/redis/service/redis_test.go @@ -30,6 +30,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { cfg *config.Redis } @@ -84,7 +85,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -105,6 +107,7 @@ func TestNew(t *testing.T) { } func Test_client_Disconnect(t *testing.T) { + t.Parallel() type fields struct { db redis.Redis opts []redis.Option @@ -170,7 +173,8 @@ func Test_client_Disconnect(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -199,6 +203,7 @@ func Test_client_Disconnect(t *testing.T) { } func Test_client_Connect(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -274,7 +279,8 @@ func Test_client_Connect(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -303,6 +309,7 @@ func Test_client_Connect(t *testing.T) { } func Test_client_Get(t *testing.T) { + t.Parallel() type args struct { key string } @@ -382,7 +389,8 @@ func Test_client_Get(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -411,6 +419,7 @@ func Test_client_Get(t *testing.T) { } func Test_client_GetMultiple(t *testing.T) { + t.Parallel() type args struct { keys []string } @@ -490,7 +499,8 @@ func Test_client_GetMultiple(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -519,6 +529,7 @@ func Test_client_GetMultiple(t *testing.T) { } func Test_client_GetInverse(t *testing.T) { + t.Parallel() type args struct { val string } @@ -598,7 +609,8 @@ func Test_client_GetInverse(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -627,6 +639,7 @@ func Test_client_GetInverse(t *testing.T) { } func Test_client_GetInverseMultiple(t *testing.T) { + t.Parallel() type args struct { vals []string } @@ -706,7 +719,8 @@ func Test_client_GetInverseMultiple(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -735,6 +749,7 @@ func Test_client_GetInverseMultiple(t *testing.T) { } func Test_client_appendPrefix(t *testing.T) { + t.Parallel() type args struct { prefix string key string @@ -813,7 +828,8 @@ func Test_client_appendPrefix(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -842,6 +858,7 @@ func Test_client_appendPrefix(t *testing.T) { } func Test_client_get(t *testing.T) { + t.Parallel() type args struct { prefix string key string @@ -924,7 +941,8 @@ func Test_client_get(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -953,6 +971,7 @@ func Test_client_get(t *testing.T) { } func Test_client_getMulti(t *testing.T) { + t.Parallel() type args struct { prefix string keys []string @@ -1035,7 +1054,8 @@ func Test_client_getMulti(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1064,6 +1084,7 @@ func Test_client_getMulti(t *testing.T) { } func Test_client_Set(t *testing.T) { + t.Parallel() type args struct { key string val string @@ -1142,7 +1163,8 @@ func Test_client_Set(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1171,6 +1193,7 @@ func Test_client_Set(t *testing.T) { } func Test_client_SetMultiple(t *testing.T) { + t.Parallel() type args struct { kvs map[string]string } @@ -1246,7 +1269,8 @@ func Test_client_SetMultiple(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1275,6 +1299,7 @@ func Test_client_SetMultiple(t *testing.T) { } func Test_client_Delete(t *testing.T) { + t.Parallel() type args struct { key string } @@ -1354,7 +1379,8 @@ func Test_client_Delete(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1383,6 +1409,7 @@ func Test_client_Delete(t *testing.T) { } func Test_client_DeleteMultiple(t *testing.T) { + t.Parallel() type args struct { keys []string } @@ -1462,7 +1489,8 @@ func Test_client_DeleteMultiple(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1491,6 +1519,7 @@ func Test_client_DeleteMultiple(t *testing.T) { } func Test_client_DeleteInverse(t *testing.T) { + t.Parallel() type args struct { val string } @@ -1570,7 +1599,8 @@ func Test_client_DeleteInverse(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1599,6 +1629,7 @@ func Test_client_DeleteInverse(t *testing.T) { } func Test_client_DeleteInverseMultiple(t *testing.T) { + t.Parallel() type args struct { vals []string } @@ -1678,7 +1709,8 @@ func Test_client_DeleteInverseMultiple(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1707,6 +1739,7 @@ func Test_client_DeleteInverseMultiple(t *testing.T) { } func Test_client_delete(t *testing.T) { + t.Parallel() type args struct { pfx string pfxInv string @@ -1792,7 +1825,8 @@ func Test_client_delete(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -1821,6 +1855,7 @@ func Test_client_delete(t *testing.T) { } func Test_client_deleteMulti(t *testing.T) { + t.Parallel() type args struct { pfx string pfxInv string @@ -1906,7 +1941,8 @@ func Test_client_deleteMulti(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/meta/redis/usecase/meta_test.go b/pkg/meta/redis/usecase/meta_test.go index 46262dcf70..7e572150a0 100644 --- a/pkg/meta/redis/usecase/meta_test.go +++ b/pkg/meta/redis/usecase/meta_test.go @@ -32,6 +32,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { cfg *config.Data } @@ -86,7 +87,8 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -107,6 +109,7 @@ func TestNew(t *testing.T) { } func Test_run_PreStart(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -179,7 +182,8 @@ func Test_run_PreStart(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -207,6 +211,7 @@ func Test_run_PreStart(t *testing.T) { } func Test_run_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -283,7 +288,8 @@ func Test_run_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -311,6 +317,7 @@ func Test_run_Start(t *testing.T) { } func Test_run_PreStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -383,7 +390,8 @@ func Test_run_PreStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -411,6 +419,7 @@ func Test_run_PreStop(t *testing.T) { } func Test_run_Stop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -483,7 +492,8 @@ func Test_run_Stop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -511,6 +521,7 @@ func Test_run_Stop(t *testing.T) { } func Test_run_PostStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -583,7 +594,8 @@ func Test_run_PostStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/tools/cli/loadtest/assets/dataset_test.go b/pkg/tools/cli/loadtest/assets/dataset_test.go index 5bc0e38bf2..635d3930ea 100644 --- a/pkg/tools/cli/loadtest/assets/dataset_test.go +++ b/pkg/tools/cli/loadtest/assets/dataset_test.go @@ -25,6 +25,7 @@ import ( ) func Test_identity(t *testing.T) { + t.Parallel() type args struct { dim int } @@ -75,7 +76,8 @@ func Test_identity(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -96,6 +98,7 @@ func Test_identity(t *testing.T) { } func Test_random(t *testing.T) { + t.Parallel() type args struct { dim int size int @@ -149,7 +152,8 @@ func Test_random(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -170,6 +174,7 @@ func Test_random(t *testing.T) { } func Test_datasetDir(t *testing.T) { + t.Parallel() type want struct { want string err error @@ -214,7 +219,8 @@ func Test_datasetDir(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -235,6 +241,7 @@ func Test_datasetDir(t *testing.T) { } func TestData(t *testing.T) { + t.Parallel() type args struct { name string } @@ -285,7 +292,8 @@ func TestData(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -306,6 +314,7 @@ func TestData(t *testing.T) { } func Test_dataset_Train(t *testing.T) { + t.Parallel() type fields struct { train [][]float32 trainAsFloat64 [][]float64 @@ -348,13 +357,13 @@ func Test_dataset_Train(t *testing.T) { fields: fields { train: nil, trainAsFloat64: nil, - trainOnce: nil, + trainOnce: sync.Once{}, query: nil, queryAsFloat64: nil, - queryOnce: nil, + queryOnce: sync.Once{}, distances: nil, distancesAsFloat64: nil, - distancesOnce: nil, + distancesOnce: sync.Once{}, neighbors: nil, ids: nil, name: "", @@ -375,13 +384,13 @@ func Test_dataset_Train(t *testing.T) { fields: fields { train: nil, trainAsFloat64: nil, - trainOnce: nil, + trainOnce: sync.Once{}, query: nil, queryAsFloat64: nil, - queryOnce: nil, + queryOnce: sync.Once{}, distances: nil, distancesAsFloat64: nil, - distancesOnce: nil, + distancesOnce: sync.Once{}, neighbors: nil, ids: nil, name: "", @@ -398,7 +407,8 @@ func Test_dataset_Train(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -436,6 +446,7 @@ func Test_dataset_Train(t *testing.T) { } func Test_dataset_TrainAsFloat64(t *testing.T) { + t.Parallel() type fields struct { train [][]float32 trainAsFloat64 [][]float64 @@ -478,13 +489,13 @@ func Test_dataset_TrainAsFloat64(t *testing.T) { fields: fields { train: nil, trainAsFloat64: nil, - trainOnce: nil, + trainOnce: sync.Once{}, query: nil, queryAsFloat64: nil, - queryOnce: nil, + queryOnce: sync.Once{}, distances: nil, distancesAsFloat64: nil, - distancesOnce: nil, + distancesOnce: sync.Once{}, neighbors: nil, ids: nil, name: "", @@ -505,13 +516,13 @@ func Test_dataset_TrainAsFloat64(t *testing.T) { fields: fields { train: nil, trainAsFloat64: nil, - trainOnce: nil, + trainOnce: sync.Once{}, query: nil, queryAsFloat64: nil, - queryOnce: nil, + queryOnce: sync.Once{}, distances: nil, distancesAsFloat64: nil, - distancesOnce: nil, + distancesOnce: sync.Once{}, neighbors: nil, ids: nil, name: "", @@ -528,7 +539,8 @@ func Test_dataset_TrainAsFloat64(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -566,6 +578,7 @@ func Test_dataset_TrainAsFloat64(t *testing.T) { } func Test_dataset_Query(t *testing.T) { + t.Parallel() type fields struct { train [][]float32 trainAsFloat64 [][]float64 @@ -608,13 +621,13 @@ func Test_dataset_Query(t *testing.T) { fields: fields { train: nil, trainAsFloat64: nil, - trainOnce: nil, + trainOnce: sync.Once{}, query: nil, queryAsFloat64: nil, - queryOnce: nil, + queryOnce: sync.Once{}, distances: nil, distancesAsFloat64: nil, - distancesOnce: nil, + distancesOnce: sync.Once{}, neighbors: nil, ids: nil, name: "", @@ -635,13 +648,13 @@ func Test_dataset_Query(t *testing.T) { fields: fields { train: nil, trainAsFloat64: nil, - trainOnce: nil, + trainOnce: sync.Once{}, query: nil, queryAsFloat64: nil, - queryOnce: nil, + queryOnce: sync.Once{}, distances: nil, distancesAsFloat64: nil, - distancesOnce: nil, + distancesOnce: sync.Once{}, neighbors: nil, ids: nil, name: "", @@ -658,7 +671,8 @@ func Test_dataset_Query(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -696,6 +710,7 @@ func Test_dataset_Query(t *testing.T) { } func Test_dataset_QueryAsFloat64(t *testing.T) { + t.Parallel() type fields struct { train [][]float32 trainAsFloat64 [][]float64 @@ -738,13 +753,13 @@ func Test_dataset_QueryAsFloat64(t *testing.T) { fields: fields { train: nil, trainAsFloat64: nil, - trainOnce: nil, + trainOnce: sync.Once{}, query: nil, queryAsFloat64: nil, - queryOnce: nil, + queryOnce: sync.Once{}, distances: nil, distancesAsFloat64: nil, - distancesOnce: nil, + distancesOnce: sync.Once{}, neighbors: nil, ids: nil, name: "", @@ -765,13 +780,13 @@ func Test_dataset_QueryAsFloat64(t *testing.T) { fields: fields { train: nil, trainAsFloat64: nil, - trainOnce: nil, + trainOnce: sync.Once{}, query: nil, queryAsFloat64: nil, - queryOnce: nil, + queryOnce: sync.Once{}, distances: nil, distancesAsFloat64: nil, - distancesOnce: nil, + distancesOnce: sync.Once{}, neighbors: nil, ids: nil, name: "", @@ -788,7 +803,8 @@ func Test_dataset_QueryAsFloat64(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -826,6 +842,7 @@ func Test_dataset_QueryAsFloat64(t *testing.T) { } func Test_dataset_Distances(t *testing.T) { + t.Parallel() type fields struct { train [][]float32 trainAsFloat64 [][]float64 @@ -868,13 +885,13 @@ func Test_dataset_Distances(t *testing.T) { fields: fields { train: nil, trainAsFloat64: nil, - trainOnce: nil, + trainOnce: sync.Once{}, query: nil, queryAsFloat64: nil, - queryOnce: nil, + queryOnce: sync.Once{}, distances: nil, distancesAsFloat64: nil, - distancesOnce: nil, + distancesOnce: sync.Once{}, neighbors: nil, ids: nil, name: "", @@ -895,13 +912,13 @@ func Test_dataset_Distances(t *testing.T) { fields: fields { train: nil, trainAsFloat64: nil, - trainOnce: nil, + trainOnce: sync.Once{}, query: nil, queryAsFloat64: nil, - queryOnce: nil, + queryOnce: sync.Once{}, distances: nil, distancesAsFloat64: nil, - distancesOnce: nil, + distancesOnce: sync.Once{}, neighbors: nil, ids: nil, name: "", @@ -918,7 +935,8 @@ func Test_dataset_Distances(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -956,6 +974,7 @@ func Test_dataset_Distances(t *testing.T) { } func Test_dataset_DistancesAsFloat64(t *testing.T) { + t.Parallel() type fields struct { train [][]float32 trainAsFloat64 [][]float64 @@ -998,13 +1017,13 @@ func Test_dataset_DistancesAsFloat64(t *testing.T) { fields: fields { train: nil, trainAsFloat64: nil, - trainOnce: nil, + trainOnce: sync.Once{}, query: nil, queryAsFloat64: nil, - queryOnce: nil, + queryOnce: sync.Once{}, distances: nil, distancesAsFloat64: nil, - distancesOnce: nil, + distancesOnce: sync.Once{}, neighbors: nil, ids: nil, name: "", @@ -1025,13 +1044,13 @@ func Test_dataset_DistancesAsFloat64(t *testing.T) { fields: fields { train: nil, trainAsFloat64: nil, - trainOnce: nil, + trainOnce: sync.Once{}, query: nil, queryAsFloat64: nil, - queryOnce: nil, + queryOnce: sync.Once{}, distances: nil, distancesAsFloat64: nil, - distancesOnce: nil, + distancesOnce: sync.Once{}, neighbors: nil, ids: nil, name: "", @@ -1048,7 +1067,8 @@ func Test_dataset_DistancesAsFloat64(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -1086,6 +1106,7 @@ func Test_dataset_DistancesAsFloat64(t *testing.T) { } func Test_dataset_Neighbors(t *testing.T) { + t.Parallel() type fields struct { train [][]float32 trainAsFloat64 [][]float64 @@ -1128,13 +1149,13 @@ func Test_dataset_Neighbors(t *testing.T) { fields: fields { train: nil, trainAsFloat64: nil, - trainOnce: nil, + trainOnce: sync.Once{}, query: nil, queryAsFloat64: nil, - queryOnce: nil, + queryOnce: sync.Once{}, distances: nil, distancesAsFloat64: nil, - distancesOnce: nil, + distancesOnce: sync.Once{}, neighbors: nil, ids: nil, name: "", @@ -1155,13 +1176,13 @@ func Test_dataset_Neighbors(t *testing.T) { fields: fields { train: nil, trainAsFloat64: nil, - trainOnce: nil, + trainOnce: sync.Once{}, query: nil, queryAsFloat64: nil, - queryOnce: nil, + queryOnce: sync.Once{}, distances: nil, distancesAsFloat64: nil, - distancesOnce: nil, + distancesOnce: sync.Once{}, neighbors: nil, ids: nil, name: "", @@ -1178,7 +1199,8 @@ func Test_dataset_Neighbors(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -1216,6 +1238,7 @@ func Test_dataset_Neighbors(t *testing.T) { } func Test_dataset_IDs(t *testing.T) { + t.Parallel() type fields struct { train [][]float32 trainAsFloat64 [][]float64 @@ -1258,13 +1281,13 @@ func Test_dataset_IDs(t *testing.T) { fields: fields { train: nil, trainAsFloat64: nil, - trainOnce: nil, + trainOnce: sync.Once{}, query: nil, queryAsFloat64: nil, - queryOnce: nil, + queryOnce: sync.Once{}, distances: nil, distancesAsFloat64: nil, - distancesOnce: nil, + distancesOnce: sync.Once{}, neighbors: nil, ids: nil, name: "", @@ -1285,13 +1308,13 @@ func Test_dataset_IDs(t *testing.T) { fields: fields { train: nil, trainAsFloat64: nil, - trainOnce: nil, + trainOnce: sync.Once{}, query: nil, queryAsFloat64: nil, - queryOnce: nil, + queryOnce: sync.Once{}, distances: nil, distancesAsFloat64: nil, - distancesOnce: nil, + distancesOnce: sync.Once{}, neighbors: nil, ids: nil, name: "", @@ -1308,7 +1331,8 @@ func Test_dataset_IDs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -1346,6 +1370,7 @@ func Test_dataset_IDs(t *testing.T) { } func Test_dataset_Name(t *testing.T) { + t.Parallel() type fields struct { train [][]float32 trainAsFloat64 [][]float64 @@ -1388,13 +1413,13 @@ func Test_dataset_Name(t *testing.T) { fields: fields { train: nil, trainAsFloat64: nil, - trainOnce: nil, + trainOnce: sync.Once{}, query: nil, queryAsFloat64: nil, - queryOnce: nil, + queryOnce: sync.Once{}, distances: nil, distancesAsFloat64: nil, - distancesOnce: nil, + distancesOnce: sync.Once{}, neighbors: nil, ids: nil, name: "", @@ -1415,13 +1440,13 @@ func Test_dataset_Name(t *testing.T) { fields: fields { train: nil, trainAsFloat64: nil, - trainOnce: nil, + trainOnce: sync.Once{}, query: nil, queryAsFloat64: nil, - queryOnce: nil, + queryOnce: sync.Once{}, distances: nil, distancesAsFloat64: nil, - distancesOnce: nil, + distancesOnce: sync.Once{}, neighbors: nil, ids: nil, name: "", @@ -1438,7 +1463,8 @@ func Test_dataset_Name(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -1476,6 +1502,7 @@ func Test_dataset_Name(t *testing.T) { } func Test_dataset_Dimension(t *testing.T) { + t.Parallel() type fields struct { train [][]float32 trainAsFloat64 [][]float64 @@ -1518,13 +1545,13 @@ func Test_dataset_Dimension(t *testing.T) { fields: fields { train: nil, trainAsFloat64: nil, - trainOnce: nil, + trainOnce: sync.Once{}, query: nil, queryAsFloat64: nil, - queryOnce: nil, + queryOnce: sync.Once{}, distances: nil, distancesAsFloat64: nil, - distancesOnce: nil, + distancesOnce: sync.Once{}, neighbors: nil, ids: nil, name: "", @@ -1545,13 +1572,13 @@ func Test_dataset_Dimension(t *testing.T) { fields: fields { train: nil, trainAsFloat64: nil, - trainOnce: nil, + trainOnce: sync.Once{}, query: nil, queryAsFloat64: nil, - queryOnce: nil, + queryOnce: sync.Once{}, distances: nil, distancesAsFloat64: nil, - distancesOnce: nil, + distancesOnce: sync.Once{}, neighbors: nil, ids: nil, name: "", @@ -1568,7 +1595,8 @@ func Test_dataset_Dimension(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -1606,6 +1634,7 @@ func Test_dataset_Dimension(t *testing.T) { } func Test_dataset_DistanceType(t *testing.T) { + t.Parallel() type fields struct { train [][]float32 trainAsFloat64 [][]float64 @@ -1648,13 +1677,13 @@ func Test_dataset_DistanceType(t *testing.T) { fields: fields { train: nil, trainAsFloat64: nil, - trainOnce: nil, + trainOnce: sync.Once{}, query: nil, queryAsFloat64: nil, - queryOnce: nil, + queryOnce: sync.Once{}, distances: nil, distancesAsFloat64: nil, - distancesOnce: nil, + distancesOnce: sync.Once{}, neighbors: nil, ids: nil, name: "", @@ -1675,13 +1704,13 @@ func Test_dataset_DistanceType(t *testing.T) { fields: fields { train: nil, trainAsFloat64: nil, - trainOnce: nil, + trainOnce: sync.Once{}, query: nil, queryAsFloat64: nil, - queryOnce: nil, + queryOnce: sync.Once{}, distances: nil, distancesAsFloat64: nil, - distancesOnce: nil, + distancesOnce: sync.Once{}, neighbors: nil, ids: nil, name: "", @@ -1698,7 +1727,8 @@ func Test_dataset_DistanceType(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -1736,6 +1766,7 @@ func Test_dataset_DistanceType(t *testing.T) { } func Test_dataset_ObjectType(t *testing.T) { + t.Parallel() type fields struct { train [][]float32 trainAsFloat64 [][]float64 @@ -1778,13 +1809,13 @@ func Test_dataset_ObjectType(t *testing.T) { fields: fields { train: nil, trainAsFloat64: nil, - trainOnce: nil, + trainOnce: sync.Once{}, query: nil, queryAsFloat64: nil, - queryOnce: nil, + queryOnce: sync.Once{}, distances: nil, distancesAsFloat64: nil, - distancesOnce: nil, + distancesOnce: sync.Once{}, neighbors: nil, ids: nil, name: "", @@ -1805,13 +1836,13 @@ func Test_dataset_ObjectType(t *testing.T) { fields: fields { train: nil, trainAsFloat64: nil, - trainOnce: nil, + trainOnce: sync.Once{}, query: nil, queryAsFloat64: nil, - queryOnce: nil, + queryOnce: sync.Once{}, distances: nil, distancesAsFloat64: nil, - distancesOnce: nil, + distancesOnce: sync.Once{}, neighbors: nil, ids: nil, name: "", @@ -1828,7 +1859,8 @@ func Test_dataset_ObjectType(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -1866,6 +1898,7 @@ func Test_dataset_ObjectType(t *testing.T) { } func Test_float32To64(t *testing.T) { + t.Parallel() type args struct { x [][]float32 } @@ -1916,7 +1949,8 @@ func Test_float32To64(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/tools/cli/loadtest/assets/loader_test.go b/pkg/tools/cli/loadtest/assets/loader_test.go index 4333e21760..69c53b8482 100644 --- a/pkg/tools/cli/loadtest/assets/loader_test.go +++ b/pkg/tools/cli/loadtest/assets/loader_test.go @@ -25,6 +25,7 @@ import ( ) func Test_loadFloat32(t *testing.T) { + t.Parallel() type args struct { dset *hdf5.Dataset npoints int @@ -88,7 +89,8 @@ func Test_loadFloat32(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -109,6 +111,7 @@ func Test_loadFloat32(t *testing.T) { } func Test_loadInt(t *testing.T) { + t.Parallel() type args struct { dset *hdf5.Dataset npoints int @@ -172,7 +175,8 @@ func Test_loadInt(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -193,6 +197,7 @@ func Test_loadInt(t *testing.T) { } func Test_loadDataset(t *testing.T) { + t.Parallel() type args struct { file *hdf5.File name string @@ -257,7 +262,8 @@ func Test_loadDataset(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -278,6 +284,7 @@ func Test_loadDataset(t *testing.T) { } func TestLoad(t *testing.T) { + t.Parallel() type args struct { path string } @@ -348,7 +355,8 @@ func TestLoad(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -369,6 +377,7 @@ func TestLoad(t *testing.T) { } func TestCreateRandomIDs(t *testing.T) { + t.Parallel() type args struct { n int } @@ -419,7 +428,8 @@ func TestCreateRandomIDs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -440,6 +450,7 @@ func TestCreateRandomIDs(t *testing.T) { } func TestCreateRandomIDsWithLength(t *testing.T) { + t.Parallel() type args struct { n int l int @@ -493,7 +504,8 @@ func TestCreateRandomIDsWithLength(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -514,6 +526,7 @@ func TestCreateRandomIDsWithLength(t *testing.T) { } func TestCreateSerialIDs(t *testing.T) { + t.Parallel() type args struct { n int } @@ -564,7 +577,8 @@ func TestCreateSerialIDs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -585,6 +599,7 @@ func TestCreateSerialIDs(t *testing.T) { } func TestLoadDataWithRandomIDs(t *testing.T) { + t.Parallel() type args struct { path string } @@ -639,7 +654,8 @@ func TestLoadDataWithRandomIDs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -660,6 +676,7 @@ func TestLoadDataWithRandomIDs(t *testing.T) { } func TestLoadDataWithSerialIDs(t *testing.T) { + t.Parallel() type args struct { path string } @@ -714,7 +731,8 @@ func TestLoadDataWithSerialIDs(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/tools/cli/loadtest/config/config_test.go b/pkg/tools/cli/loadtest/config/config_test.go index 4b2bea9526..68f90a4720 100644 --- a/pkg/tools/cli/loadtest/config/config_test.go +++ b/pkg/tools/cli/loadtest/config/config_test.go @@ -26,6 +26,7 @@ import ( ) func TestOperationMethod(t *testing.T) { + t.Parallel() type args struct { s string } @@ -76,7 +77,8 @@ func TestOperationMethod(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -97,6 +99,7 @@ func TestOperationMethod(t *testing.T) { } func TestOperation_String(t *testing.T) { + t.Parallel() type want struct { want string } @@ -138,7 +141,8 @@ func TestOperation_String(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } @@ -159,6 +163,7 @@ func TestOperation_String(t *testing.T) { } func TestNewConfig(t *testing.T) { + t.Parallel() type args struct { path string } @@ -213,7 +218,8 @@ func TestNewConfig(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/tools/cli/loadtest/service/insert_test.go b/pkg/tools/cli/loadtest/service/insert_test.go index 6424701519..e2cc9916e5 100644 --- a/pkg/tools/cli/loadtest/service/insert_test.go +++ b/pkg/tools/cli/loadtest/service/insert_test.go @@ -24,6 +24,7 @@ import ( ) func Test_newInsert(t *testing.T) { + t.Parallel() type want struct { want requestFunc want1 loaderFunc @@ -68,7 +69,8 @@ func Test_newInsert(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } diff --git a/pkg/tools/cli/loadtest/service/loader_option_test.go b/pkg/tools/cli/loadtest/service/loader_option_test.go index 21193791a6..fe74216810 100644 --- a/pkg/tools/cli/loadtest/service/loader_option_test.go +++ b/pkg/tools/cli/loadtest/service/loader_option_test.go @@ -24,6 +24,8 @@ import ( ) func TestWithAddr(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { a string @@ -61,7 +63,7 @@ func TestWithAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -99,7 +101,8 @@ func TestWithAddr(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -120,7 +123,7 @@ func TestWithAddr(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -128,7 +131,7 @@ func TestWithAddr(t *testing.T) { got := WithAddr(test.args.a) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -137,6 +140,8 @@ func TestWithAddr(t *testing.T) { } func TestWithClient(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { c grpc.Client @@ -174,7 +179,7 @@ func TestWithClient(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -212,7 +217,8 @@ func TestWithClient(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -233,7 +239,7 @@ func TestWithClient(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -241,7 +247,7 @@ func TestWithClient(t *testing.T) { got := WithClient(test.args.c) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -250,6 +256,8 @@ func TestWithClient(t *testing.T) { } func TestWithConcurrency(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { c int @@ -287,7 +295,7 @@ func TestWithConcurrency(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -325,7 +333,8 @@ func TestWithConcurrency(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -346,7 +355,7 @@ func TestWithConcurrency(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -354,7 +363,7 @@ func TestWithConcurrency(t *testing.T) { got := WithConcurrency(test.args.c) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -363,6 +372,8 @@ func TestWithConcurrency(t *testing.T) { } func TestWithDataset(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { n string @@ -400,7 +411,7 @@ func TestWithDataset(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -438,7 +449,8 @@ func TestWithDataset(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -459,7 +471,7 @@ func TestWithDataset(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -467,7 +479,7 @@ func TestWithDataset(t *testing.T) { got := WithDataset(test.args.n) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -476,6 +488,8 @@ func TestWithDataset(t *testing.T) { } func TestWithErrGroup(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { eg errgroup.Group @@ -513,7 +527,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -551,7 +565,8 @@ func TestWithErrGroup(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -572,7 +587,7 @@ func TestWithErrGroup(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -580,7 +595,7 @@ func TestWithErrGroup(t *testing.T) { got := WithErrGroup(test.args.eg) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -589,6 +604,8 @@ func TestWithErrGroup(t *testing.T) { } func TestWithProgressDuration(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { pd string @@ -626,7 +643,7 @@ func TestWithProgressDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -664,7 +681,8 @@ func TestWithProgressDuration(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -685,7 +703,7 @@ func TestWithProgressDuration(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -693,7 +711,7 @@ func TestWithProgressDuration(t *testing.T) { got := WithProgressDuration(test.args.pd) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ @@ -702,6 +720,8 @@ func TestWithProgressDuration(t *testing.T) { } func TestWithOperation(t *testing.T) { + t.Parallel() + // Change interface type to the type of object you are testing type T = interface{} type args struct { op string @@ -739,7 +759,7 @@ func TestWithOperation(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.obj) } return nil } @@ -777,7 +797,8 @@ func TestWithOperation(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -798,7 +819,7 @@ func TestWithOperation(t *testing.T) { } */ - // Uncomment this block if the option returns an error, otherwise delete it + // Uncomment this block if the option do not return an error, otherwise delete it /* if test.checkFunc == nil { test.checkFunc = defaultCheckFunc @@ -806,7 +827,7 @@ func TestWithOperation(t *testing.T) { got := WithOperation(test.args.op) obj := new(T) got(obj) - if err := test.checkFunc(tt.want, obj); err != nil { + if err := test.checkFunc(test.want, obj); err != nil { tt.Errorf("error = %v", err) } */ diff --git a/pkg/tools/cli/loadtest/service/loader_test.go b/pkg/tools/cli/loadtest/service/loader_test.go index c0c66fd757..b05c3bde38 100644 --- a/pkg/tools/cli/loadtest/service/loader_test.go +++ b/pkg/tools/cli/loadtest/service/loader_test.go @@ -29,6 +29,7 @@ import ( ) func TestNewLoader(t *testing.T) { + t.Parallel() type args struct { opts []Option } @@ -83,7 +84,8 @@ func TestNewLoader(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -104,6 +106,7 @@ func TestNewLoader(t *testing.T) { } func Test_loader_Prepare(t *testing.T) { + t.Parallel() type args struct { in0 context.Context } @@ -191,7 +194,8 @@ func Test_loader_Prepare(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } @@ -224,6 +228,7 @@ func Test_loader_Prepare(t *testing.T) { } func Test_loader_Do(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -311,7 +316,8 @@ func Test_loader_Do(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) } diff --git a/pkg/tools/cli/loadtest/service/search_test.go b/pkg/tools/cli/loadtest/service/search_test.go index 5504c779c2..919ead5272 100644 --- a/pkg/tools/cli/loadtest/service/search_test.go +++ b/pkg/tools/cli/loadtest/service/search_test.go @@ -24,6 +24,7 @@ import ( ) func Test_newSearch(t *testing.T) { + t.Parallel() type want struct { want requestFunc want1 loaderFunc @@ -68,7 +69,8 @@ func Test_newSearch(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(t) + tt.Parallel() + defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc() } diff --git a/pkg/tools/cli/loadtest/usecase/load_test.go b/pkg/tools/cli/loadtest/usecase/load_test.go index c2f5768d7c..74f07a0e81 100644 --- a/pkg/tools/cli/loadtest/usecase/load_test.go +++ b/pkg/tools/cli/loadtest/usecase/load_test.go @@ -31,6 +31,7 @@ import ( ) func TestNew(t *testing.T) { + t.Parallel() type args struct { cfg *config.Data } @@ -85,6 +86,7 @@ func TestNew(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -106,6 +108,7 @@ func TestNew(t *testing.T) { } func Test_run_PreStart(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -172,6 +175,7 @@ func Test_run_PreStart(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -198,6 +202,7 @@ func Test_run_PreStart(t *testing.T) { } func Test_run_Start(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -268,6 +273,7 @@ func Test_run_Start(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -294,6 +300,7 @@ func Test_run_Start(t *testing.T) { } func Test_run_PreStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -360,6 +367,7 @@ func Test_run_PreStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -386,6 +394,7 @@ func Test_run_PreStop(t *testing.T) { } func Test_run_Stop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -452,6 +461,7 @@ func Test_run_Stop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) @@ -478,6 +488,7 @@ func Test_run_Stop(t *testing.T) { } func Test_run_PostStop(t *testing.T) { + t.Parallel() type args struct { ctx context.Context } @@ -544,6 +555,7 @@ func Test_run_PostStop(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { + tt.Parallel() defer goleak.VerifyNone(tt) if test.beforeFunc != nil { test.beforeFunc(test.args) diff --git a/versions/GO_VERSION b/versions/GO_VERSION index 4e00d0ac07..c6ba3bc1a4 100644 --- a/versions/GO_VERSION +++ b/versions/GO_VERSION @@ -1 +1 @@ -1.14.4 +1.14.6