Skip to content

Commit

Permalink
Merge pull request #126344 from MikeSpreitzer/fix-120112
Browse files Browse the repository at this point in the history
Relax noise margin in TestOneWeightedHistogram

Kubernetes-commit: 2aa468c7082442f9ea068837999fe8a1e9fe520c
  • Loading branch information
k8s-publishing-bot committed Aug 1, 2024
2 parents 95f30f1 + d64a96d commit 6332889
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ require (
go.uber.org/zap v1.26.0
golang.org/x/sys v0.21.0
gopkg.in/yaml.v2 v2.4.0
k8s.io/apimachinery v0.0.0-20240720202316-95b78024e3fe
k8s.io/client-go v0.0.0-20240725210749-4536e5a391f8
k8s.io/apimachinery v0.0.0-20240719190441-a8f449e276fe
k8s.io/client-go v0.0.0-20240801004130-5e3e8ea98fe9
k8s.io/klog/v2 v2.130.1
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd
Expand Down Expand Up @@ -76,7 +76,7 @@ require (
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/api v0.0.0-20240725200553-fb1fc3084c0e // indirect
k8s.io/api v0.0.0-20240801003428-382a0912e579 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,12 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
k8s.io/api v0.0.0-20240725200553-fb1fc3084c0e h1:zSGnlOF57ubuWLnmPjHd1c9XRaXJeXdcVsszq+wm17o=
k8s.io/api v0.0.0-20240725200553-fb1fc3084c0e/go.mod h1:ytlEzqC2wOTwYET71W7+J+k7O2V7vrDuzmNLBSpgT+k=
k8s.io/apimachinery v0.0.0-20240720202316-95b78024e3fe h1:V9MwpYUwbKlfLKVrhpVuKWiat/LBIhm1pGB9/xdHm5Q=
k8s.io/apimachinery v0.0.0-20240720202316-95b78024e3fe/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo=
k8s.io/client-go v0.0.0-20240725210749-4536e5a391f8 h1:ne00XpPG8VqvDVLT5nhjP/GpVQSQVthGm3ivE/YCawA=
k8s.io/client-go v0.0.0-20240725210749-4536e5a391f8/go.mod h1:SORxrGJjz+pQkGtVEBP5ilXUslm+iXOJRgvngcKr6+Q=
k8s.io/api v0.0.0-20240801003428-382a0912e579 h1:pElFtnw6/eJb1SLes+tbAqfL/7IezesSZ1bLTO+b2UE=
k8s.io/api v0.0.0-20240801003428-382a0912e579/go.mod h1:sSxNOmsgxkyv9k7Nu9ysVYNCkTkTemOgz4HxbATSKDQ=
k8s.io/apimachinery v0.0.0-20240719190441-a8f449e276fe h1:lt6b7CTEYMgUTCGIZrATyWMZTQThE+qIQq5YTCbpMVQ=
k8s.io/apimachinery v0.0.0-20240719190441-a8f449e276fe/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo=
k8s.io/client-go v0.0.0-20240801004130-5e3e8ea98fe9 h1:FtksMSsr8nNBmsSXlqvs3hPE/7BJ5wI/mJYjGypoEtk=
k8s.io/client-go v0.0.0-20240801004130-5e3e8ea98fe9/go.mod h1:2bbCJ3Sd+yFlCoexz86XNKsJ8hBFUVTeHsjEhrODbfE=
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag=
Expand Down
8 changes: 5 additions & 3 deletions metrics/prometheusextension/weighted_histogram_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func exerciseWeightedHistograms(t *testing.T, whSpecs ...weightedHistogramSpecFu
for _, term := range terms {
ee.sum += term
}
t.Logf("Adding expectation %#+v", ee)
t.Logf("At idx=%v, adding expectation of buckets=%#+v, upperBounds=%#+v, sum=%v, count=%v", whIdx, ee.buckets, ee.upperBounds, ee.sum, ee.count)
expectations = append(expectations, ee)
}
// Do the planned calls on ObserveWithWeight, in randomized order
Expand Down Expand Up @@ -142,8 +142,10 @@ func exerciseWeightedHistograms(t *testing.T, whSpecs ...weightedHistogramSpecFu
actualSum := actualHist.GetSampleSum()
num := math.Abs(actualSum - ee.sum)
den := math.Max(math.Abs(actualSum), math.Abs(ee.sum))
if num > den/1e14 {
t.Errorf("At idx=%d, expected sum %v but got %v, err=%v", idx, ee.sum, actualSum, actualSum-ee.sum)
relErr := num / den
// Issue 120112 reports relative errors as high as 9.55994394104272e-14
if relErr > 1e-13 {
t.Errorf("At idx=%d, expected sum %v but got %v, err=%v, relativeErr=%v", idx, ee.sum, actualSum, actualSum-ee.sum, relErr)
}
}
}
Expand Down

0 comments on commit 6332889

Please sign in to comment.