-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Description
openedon Aug 13, 2024
Failed Tests
- Test Names:
- x-pack/metricbeat/module/cockroachdb/status TestEventMapping/cockroachdb-status.v19.1.1.plain
- x-pack/metricbeat/module/cockroachdb/status TestEventMapping
- x-pack/metricbeat/module/coredns/stats TestData/coredns_1.5.0.plain
- x-pack/metricbeat/module/coredns/stats TestData/docs.plain
- x-pack/metricbeat/module/coredns/stats TestData/prometheus_full_output.plain
- x-pack/metricbeat/module/coredns/stats TestData/request_duration.plain
- x-pack/metricbeat/module/coredns/stats TestData/request_size.plain
- x-pack/metricbeat/module/coredns/stats TestData/response_size.plain
- x-pack/metricbeat/module/coredns/stats TestData
- x-pack/metricbeat/module/istio/citadel TestData/docs.plain
- x-pack/metricbeat/module/istio/citadel TestData
- x-pack/metricbeat/module/istio/galley TestData/docs.plain
- x-pack/metricbeat/module/istio/galley TestData
- x-pack/metricbeat/module/istio/mesh TestData/docs.plain
- x-pack/metricbeat/module/istio/mesh TestData
- x-pack/metricbeat/module/istio/proxy TestEventMapping/proxy.v1.7.1.plain
- x-pack/metricbeat/module/istio/proxy TestEventMapping
- x-pack/metricbeat/module/prometheus/collector TestPromHistogramToES/new_bucket_between_two_other_buckets_on_the_go
- x-pack/metricbeat/module/prometheus/collector TestPromHistogramToES
- Link:
- x-pack/metricbeat/module/cockroachdb/status TestEventMapping
beats/x-pack/metricbeat/module/cockroachdb/status/status_test.go
Lines 29 to 33 in 5e5f5d4
func TestEventMapping(t *testing.T) { logp.TestingSetup() mbtest.TestDataFiles(t, "cockroachdb", "status") } - x-pack/metricbeat/module/coredns/stats TestData
beats/x-pack/metricbeat/module/coredns/stats/stats_test.go
Lines 18 to 20 in 5e5f5d4
func TestData(t *testing.T) { mbtest.TestDataFiles(t, "coredns", "stats") } - x-pack/metricbeat/module/istio/citadel TestData
beats/x-pack/metricbeat/module/istio/citadel/citadel_test.go
Lines 18 to 20 in 5e5f5d4
func TestData(t *testing.T) { mbtest.TestDataFiles(t, "istio", "citadel") } - x-pack/metricbeat/module/istio/galley TestData
beats/x-pack/metricbeat/module/istio/galley/galley_test.go
Lines 18 to 20 in 5e5f5d4
func TestData(t *testing.T) { mbtest.TestDataFiles(t, "istio", "galley") } - x-pack/metricbeat/module/istio/mesh TestData
beats/x-pack/metricbeat/module/istio/mesh/mesh_test.go
Lines 18 to 20 in 5e5f5d4
func TestData(t *testing.T) { mbtest.TestDataFiles(t, "istio", "mesh") } - x-pack/metricbeat/module/istio/proxy
beats/x-pack/metricbeat/module/istio/proxy/proxy_test.go
Lines 29 to 33 in 5e5f5d4
func TestEventMapping(t *testing.T) { logp.TestingSetup() mbtest.TestDataFiles(t, "istio", "proxy") } - x-pack/metricbeat/module/prometheus/collector TestPromHistogramToES
beats/x-pack/metricbeat/module/prometheus/collector/histogram_test.go
Lines 24 to 466 in 5e5f5d4
func TestPromHistogramToES(t *testing.T) { type sample struct { histogram p.Histogram expected mapstr.M } cases := map[string]struct { samples []sample }{ "one histogram": { samples: []sample{ { histogram: p.Histogram{ SampleCount: proto.Uint64(10), SampleSum: proto.Float64(10), Bucket: []*p.Bucket{ { UpperBound: proto.Float64(0.99), CumulativeCount: proto.Uint64(10), }, }, }, expected: mapstr.M{ "counts": []uint64{0}, "values": []float64{0.495}, }, }, }, }, "two histogram": { samples: []sample{ { histogram: p.Histogram{ SampleCount: proto.Uint64(10), SampleSum: proto.Float64(10), Bucket: []*p.Bucket{ { UpperBound: proto.Float64(0.99), CumulativeCount: proto.Uint64(10), }, }, }, expected: mapstr.M{ "counts": []uint64{0}, "values": []float64{0.495}, }, }, { histogram: p.Histogram{ SampleCount: proto.Uint64(12), SampleSum: proto.Float64(10.123), Bucket: []*p.Bucket{ { UpperBound: proto.Float64(0.99), CumulativeCount: proto.Uint64(12), }, }, }, expected: mapstr.M{ "counts": []uint64{2}, "values": []float64{0.495}, }, }, }, }, "new bucket on the go": { samples: []sample{ { histogram: p.Histogram{ SampleCount: proto.Uint64(10), SampleSum: proto.Float64(10), Bucket: []*p.Bucket{ { UpperBound: proto.Float64(0.99), CumulativeCount: proto.Uint64(10), }, }, }, expected: mapstr.M{ "counts": []uint64{0}, "values": []float64{0.495}, }, }, { histogram: p.Histogram{ SampleCount: proto.Uint64(13), SampleSum: proto.Float64(15.23), Bucket: []*p.Bucket{ { UpperBound: proto.Float64(0.99), CumulativeCount: proto.Uint64(12), }, // New bucket on the go { UpperBound: proto.Float64(9.99), CumulativeCount: proto.Uint64(13), }, }, }, expected: mapstr.M{ "counts": []uint64{2, 0}, "values": []float64{0.495, 5.49}, }, }, { histogram: p.Histogram{ SampleCount: proto.Uint64(15), SampleSum: proto.Float64(16.33), Bucket: []*p.Bucket{ { UpperBound: proto.Float64(0.99), CumulativeCount: proto.Uint64(13), }, { UpperBound: proto.Float64(9.99), CumulativeCount: proto.Uint64(15), }, }, }, expected: mapstr.M{ "counts": []uint64{1, 1}, "values": []float64{0.495, 5.49}, }, }, { histogram: p.Histogram{ SampleCount: proto.Uint64(16), SampleSum: proto.Float64(16.33), Bucket: []*p.Bucket{ { UpperBound: proto.Float64(0.99), CumulativeCount: proto.Uint64(13), }, { UpperBound: proto.Float64(9.99), CumulativeCount: proto.Uint64(16), }, }, }, expected: mapstr.M{ "counts": []uint64{0, 1}, "values": []float64{0.495, 5.49}, }, }, }, }, "new smaller bucket on the go": { samples: []sample{ { histogram: p.Histogram{ SampleCount: proto.Uint64(10), SampleSum: proto.Float64(10), Bucket: []*p.Bucket{ { UpperBound: proto.Float64(0.99), CumulativeCount: proto.Uint64(10), }, }, }, expected: mapstr.M{ "counts": []uint64{0}, "values": []float64{0.495}, }, }, { histogram: p.Histogram{ SampleCount: proto.Uint64(13), SampleSum: proto.Float64(15.23), Bucket: []*p.Bucket{ // New bucket on the go { UpperBound: proto.Float64(0.09), CumulativeCount: proto.Uint64(1), }, { UpperBound: proto.Float64(0.99), CumulativeCount: proto.Uint64(13), }, }, }, expected: mapstr.M{ "counts": []uint64{0, 2}, "values": []float64{0.045, 0.54}, }, }, { histogram: p.Histogram{ SampleCount: proto.Uint64(15), SampleSum: proto.Float64(16.33), Bucket: []*p.Bucket{ { UpperBound: proto.Float64(0.09), CumulativeCount: proto.Uint64(2), }, { UpperBound: proto.Float64(0.99), CumulativeCount: proto.Uint64(15), }, }, }, expected: mapstr.M{ "counts": []uint64{1, 1}, "values": []float64{0.045, 0.54}, }, }, { histogram: p.Histogram{ SampleCount: proto.Uint64(16), SampleSum: proto.Float64(16.33), Bucket: []*p.Bucket{ { UpperBound: proto.Float64(0.09), CumulativeCount: proto.Uint64(3), }, { UpperBound: proto.Float64(0.99), CumulativeCount: proto.Uint64(16), }, }, }, expected: mapstr.M{ "counts": []uint64{1, 0}, "values": []float64{0.045, 0.54}, }, }, }, }, "new bucket between two other buckets on the go": { samples: []sample{ { histogram: p.Histogram{ SampleCount: proto.Uint64(10), SampleSum: proto.Float64(10), Bucket: []*p.Bucket{ { UpperBound: proto.Float64(0.09), CumulativeCount: proto.Uint64(0), }, { UpperBound: proto.Float64(0.99), CumulativeCount: proto.Uint64(10), }, }, }, expected: mapstr.M{ "counts": []uint64{0, 0}, "values": []float64{0.045, 0.54}, }, }, { histogram: p.Histogram{ SampleCount: proto.Uint64(13), SampleSum: proto.Float64(15.23), Bucket: []*p.Bucket{ { UpperBound: proto.Float64(0.09), CumulativeCount: proto.Uint64(1), }, // New bucket { UpperBound: proto.Float64(0.49), CumulativeCount: proto.Uint64(2), }, { UpperBound: proto.Float64(0.99), CumulativeCount: proto.Uint64(13), }, }, }, expected: mapstr.M{ "counts": []uint64{1, 0, 1}, "values": []float64{0.045, 0.29000000000000004, 0.74}, }, }, { histogram: p.Histogram{ SampleCount: proto.Uint64(16), SampleSum: proto.Float64(16.33), Bucket: []*p.Bucket{ { UpperBound: proto.Float64(0.09), CumulativeCount: proto.Uint64(2), }, { UpperBound: proto.Float64(0.49), CumulativeCount: proto.Uint64(4), }, { UpperBound: proto.Float64(0.99), CumulativeCount: proto.Uint64(16), }, }, }, expected: mapstr.M{ "counts": []uint64{1, 1, 1}, "values": []float64{0.045, 0.29000000000000004, 0.74}, }, }, { histogram: p.Histogram{ SampleCount: proto.Uint64(18), SampleSum: proto.Float64(16.33), Bucket: []*p.Bucket{ { UpperBound: proto.Float64(0.09), CumulativeCount: proto.Uint64(3), }, { UpperBound: proto.Float64(0.49), CumulativeCount: proto.Uint64(5), }, { UpperBound: proto.Float64(0.99), CumulativeCount: proto.Uint64(18), }, }, }, expected: mapstr.M{ "counts": []uint64{1, 0, 1}, "values": []float64{0.045, 0.29000000000000004, 0.74}, }, }, }, }, "wrong buckets": { samples: []sample{ { histogram: p.Histogram{ SampleCount: proto.Uint64(10), SampleSum: proto.Float64(10), Bucket: []*p.Bucket{ { UpperBound: proto.Float64(0.09), CumulativeCount: proto.Uint64(10), }, { UpperBound: proto.Float64(0.99), CumulativeCount: proto.Uint64(8), }, }, }, expected: mapstr.M{ "counts": []uint64{0, 0}, "values": []float64{0.045, 0.54}, }, }, { histogram: p.Histogram{ SampleCount: proto.Uint64(12), SampleSum: proto.Float64(10.45), Bucket: []*p.Bucket{ { UpperBound: proto.Float64(0.09), CumulativeCount: proto.Uint64(12), }, { UpperBound: proto.Float64(0.99), CumulativeCount: proto.Uint64(8), }, }, }, expected: mapstr.M{ "counts": []uint64{2, 0}, "values": []float64{0.045, 0.54}, }, }, }, }, "histogram with negative buckets": { samples: []sample{ { histogram: p.Histogram{ SampleCount: proto.Uint64(30), SampleSum: proto.Float64(5), Bucket: []*p.Bucket{ { UpperBound: proto.Float64(-100), CumulativeCount: proto.Uint64(2), }, { UpperBound: proto.Float64(-99), CumulativeCount: proto.Uint64(10), }, { UpperBound: proto.Float64(0), CumulativeCount: proto.Uint64(30), }, }, }, expected: mapstr.M{ // rate of the first bucket is always 0, meaning that it was not increased as it is the first // count rate: [0, 8, 20] "counts": []uint64{0, 0, 0}, "values": []float64{-100, -99.5, -49.5}, }, }, { histogram: p.Histogram{ SampleCount: proto.Uint64(100), SampleSum: proto.Float64(20), Bucket: []*p.Bucket{ { UpperBound: proto.Float64(-100), CumulativeCount: proto.Uint64(5), }, { UpperBound: proto.Float64(-99), CumulativeCount: proto.Uint64(16), }, { UpperBound: proto.Float64(0), CumulativeCount: proto.Uint64(100), }, }, }, expected: mapstr.M{ // counts calculation: // UpperBound -100: 5-2 // UpperBound -99: 16 - 5 (undo accumulation) - 8 (calculate rate) // UpperBound 0: 100 - 16 (undo accumulation) - 20 (calculate rate) "counts": []uint64{3, 3, 64}, "values": []float64{-100, -99.5, -49.5}, }, }, }, }, } metricName := "somemetric" labels := mapstr.M{} for title, c := range cases { t.Run(title, func(t *testing.T) { cache := NewCounterCache(120 * time.Minute) for i, s := range c.samples { t.Logf("#%d: %+v", i, s.histogram) result := PromHistogramToES(cache, metricName, labels, &s.histogram) assert.EqualValues(t, s.expected, result) } }) } }
-
Branch: main (related PR: Enable tests that were muted during migration #40387)
-
Artifact Link: beats-xpack-metricbeat_build_5859_mac-x-pack-slash-metricbeat-macos-arm64-unit-tests.log
Buildkite build: https://buildkite.com/elastic/beats-xpack-metricbeat/builds/5859#0191477b-e9a0-4e91-ad35-eeaf4a7b8b92 -
Notes: Additional details about the test. e.g. theory as to failure cause
For x-pack/metricbeat macOS arm64 tests (macosM1 stage) were disabled due to Extended / x-pack/metricbeat-macosM1-orka && darwin && aarch64 / TestData – github.com/elastic/beats/v7/x-pack/metricbeat/module/* #33036. After migration to Buildkite unit tests still fail with same errors when running on macOS arm.
Tests will remain disabled as it was on Jenkins, while failures are not fixed.
Creating new issue, since #33036 was Jenkins related.
To execute tests on CI:
- Comment skip condition for :mac: x-pack/metricbeat macOS arm64 Unit Tests step
- Add macOS label on PR, otherwise tests won't be executed