Skip to content

Commit

Permalink
[OTEL-2047] Fix flaky APM stats bucket test (#28543)
Browse files Browse the repository at this point in the history
  • Loading branch information
songy23 authored Aug 20, 2024
1 parent f713f0e commit 37bf9a0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions comp/otelcol/otlp/components/statsprocessor/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,13 @@ func TestTraceAgent(t *testing.T) {
case stats = <-out:
if len(stats.Stats) != 0 {
require.Len(t, stats.Stats, 1)
require.Len(t, stats.Stats[0].Stats, 1)
assert.Greater(t, len(stats.Stats[0].Stats[0].Stats), 0)
actual = append(actual, stats.Stats[0].Stats[0].Stats...)
cspayload := stats.Stats[0]
// stats can be in one or multiple buckets
assert.Greater(t, len(cspayload.Stats), 0)
for _, bucket := range cspayload.Stats {
assert.Greater(t, len(bucket.Stats), 0)
actual = append(actual, bucket.Stats...)
}
}
case <-timeout:
t.Fatal("timed out")
Expand Down

0 comments on commit 37bf9a0

Please sign in to comment.