From 22994af264aa347802d19d306403acf4c9623e0e Mon Sep 17 00:00:00 2001 From: Matt Moore Date: Fri, 14 Feb 2020 07:56:41 -0800 Subject: [PATCH] Auto-update dependencies (#204) Produced via: `dep ensure -update knative.dev/test-infra knative.dev/pkg` /assign n3wscott /cc n3wscott --- Gopkg.lock | 6 ++--- vendor/knative.dev/pkg/Gopkg.lock | 4 ++-- .../pkg/apis/duck/v1/source_types.go | 3 +-- .../pkg/metrics/metricstest/metricstest.go | 15 +++++++++++++ vendor/knative.dev/pkg/tracker/enqueue.go | 22 +++++++++++++++---- 5 files changed, 39 insertions(+), 11 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index 7b6da159..9598f808 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -966,7 +966,7 @@ [[projects]] branch = "master" - digest = "1:e71caa2e846cf80d5c362a7189f6a9276f8d60b96dd95b52a11ac321270098f6" + digest = "1:112a8273481730053f435aee0101436a4b59842ea09c660ee5a3647ee9fc8c7b" name = "knative.dev/pkg" packages = [ "apis", @@ -986,7 +986,7 @@ "reconciler", ] pruneopts = "T" - revision = "602d92f69b660a5a84cbe96a9be21723f6f52d3d" + revision = "d8b36f3593257b2b39ab9bb6fbd8ad6828983755" [[projects]] branch = "master" @@ -997,7 +997,7 @@ "tools/dep-collector", ] pruneopts = "UT" - revision = "279d938f5e19db2550bea7f71f4cdb97e0d84128" + revision = "fb2b3564c1e56cd0dadd4515f3ef0fd803da3755" [[projects]] digest = "1:8730e0150dfb2b7e173890c8b9868e7a273082ef8e39f4940e3506a481cf895c" diff --git a/vendor/knative.dev/pkg/Gopkg.lock b/vendor/knative.dev/pkg/Gopkg.lock index a0f0e2a3..eb55ee4f 100644 --- a/vendor/knative.dev/pkg/Gopkg.lock +++ b/vendor/knative.dev/pkg/Gopkg.lock @@ -1323,14 +1323,14 @@ [[projects]] branch = "master" - digest = "1:d2545cd71ef3604f5d2d792e569c6e3a4df31e336d76e709b0b8bac759c0faf7" + digest = "1:691951c6805590983ccea7c6dbca360bcb58af5f4d60f75af9499903bb3039e9" name = "knative.dev/test-infra" packages = [ "scripts", "tools/dep-collector", ] pruneopts = "UT" - revision = "c7c50ccd8082344a5f8ea85a5ae8de59308d325c" + revision = "279d938f5e19db2550bea7f71f4cdb97e0d84128" [[projects]] digest = "1:8730e0150dfb2b7e173890c8b9868e7a273082ef8e39f4940e3506a481cf895c" diff --git a/vendor/knative.dev/pkg/apis/duck/v1/source_types.go b/vendor/knative.dev/pkg/apis/duck/v1/source_types.go index 321156d7..78255647 100644 --- a/vendor/knative.dev/pkg/apis/duck/v1/source_types.go +++ b/vendor/knative.dev/pkg/apis/duck/v1/source_types.go @@ -48,8 +48,7 @@ type Source struct { } type SourceSpec struct { - // Sink is a reference to an object that will resolve to a domain name or a - // URI directly to use as the sink. + // Sink is a reference to an object that will resolve to a uri to use as the sink. Sink Destination `json:"sink,omitempty"` // CloudEventOverrides defines overrides to control the output format and diff --git a/vendor/knative.dev/pkg/metrics/metricstest/metricstest.go b/vendor/knative.dev/pkg/metrics/metricstest/metricstest.go index f67363c3..0e967c83 100644 --- a/vendor/knative.dev/pkg/metrics/metricstest/metricstest.go +++ b/vendor/knative.dev/pkg/metrics/metricstest/metricstest.go @@ -90,6 +90,21 @@ func CheckDistributionData(t test.T, name string, wantTags map[string]string, ex } } +// CheckDistributionRange checks the view with a name matching string name to verify that the DistributionData stats reported +// are tagged with the tags in wantTags and that expectedCount number of records were reported. +func CheckDistributionCount(t test.T, name string, wantTags map[string]string, expectedCount int64) { + t.Helper() + if row := checkExactlyOneRow(t, name); row != nil { + checkRowTags(t, row, name, wantTags) + + if s, ok := row.Data.(*view.DistributionData); !ok { + t.Error("want DistributionData", "metric", name, "got", reflect.TypeOf(row.Data)) + } else if s.Count != expectedCount { + t.Error("reporter count wrong", "metric", name, "got", s.Count, "want", expectedCount) + } + } +} + // CheckLastValueData checks the view with a name matching string name to verify that the LastValueData stats // reported are tagged with the tags in wantTags and that wantValue matches reported last value. func CheckLastValueData(t test.T, name string, wantTags map[string]string, wantValue float64) { diff --git a/vendor/knative.dev/pkg/tracker/enqueue.go b/vendor/knative.dev/pkg/tracker/enqueue.go index 4a40a129..a8f02ea6 100644 --- a/vendor/knative.dev/pkg/tracker/enqueue.go +++ b/vendor/knative.dev/pkg/tracker/enqueue.go @@ -131,6 +131,13 @@ func (i *impl) TrackReference(ref Reference, obj interface{}) error { key := types.NamespacedName{Namespace: object.GetNamespace(), Name: object.GetName()} i.m.Lock() + // Call the callback without the lock held. + var keys []types.NamespacedName + defer func(cb func(types.NamespacedName)) { + for _, key := range keys { + cb(key) + } + }(i.cb) // read i.cb with the lock held defer i.m.Unlock() if i.exact == nil { i.exact = make(map[Reference]set) @@ -158,7 +165,7 @@ func (i *impl) TrackReference(ref Reference, obj interface{}) error { // The simplest way of eliminating such a window is to call the // callback to "catch up" immediately following new // registrations. - i.cb(key) + keys = append(keys, key) } // Overwrite the key with a new expiration. l[key] = time.Now().Add(i.leaseDuration) @@ -191,7 +198,7 @@ func (i *impl) TrackReference(ref Reference, obj interface{}) error { // The simplest way of eliminating such a window is to call the // callback to "catch up" immediately following new // registrations. - i.cb(key) + keys = append(keys, key) } // Overwrite the key with a new expiration. l[key] = matcher{ @@ -223,6 +230,13 @@ func (i *impl) OnChanged(obj interface{}) { } i.m.Lock() + // Call the callbacks without the lock held. + var keys []types.NamespacedName + defer func(cb func(types.NamespacedName)) { + for _, key := range keys { + cb(key) + } + }(i.cb) // read i.cb with the lock held defer i.m.Unlock() // Handle exact matches. @@ -234,7 +248,7 @@ func (i *impl) OnChanged(obj interface{}) { delete(s, key) continue } - i.cb(key) + keys = append(keys, key) } if len(s) == 0 { delete(i.exact, ref) @@ -253,7 +267,7 @@ func (i *impl) OnChanged(obj interface{}) { continue } if m.selector.Matches(ls) { - i.cb(key) + keys = append(keys, key) } } if len(s) == 0 {