Auto-update dependencies (#204)

Produced via:
  `dep ensure -update knative.dev/test-infra knative.dev/pkg`
/assign n3wscott
/cc n3wscott
This commit is contained in:
Matt Moore 2020-02-14 07:56:41 -08:00 committed by GitHub
parent 8b0cd41569
commit 22994af264
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 39 additions and 11 deletions

6
Gopkg.lock generated
View File

@ -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"

4
vendor/knative.dev/pkg/Gopkg.lock generated vendored
View File

@ -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"

View File

@ -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

View File

@ -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) {

View File

@ -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 {