Skip to content

Commit

Permalink
test received
Browse files Browse the repository at this point in the history
  • Loading branch information
endorama committed Jun 30, 2023
1 parent f450738 commit 69c1a4c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions input/otlp/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,16 @@ func eventsMatch(t *testing.T, expected []*modelpb.APMEvent, actual []*modelpb.A
sort.Slice(actual, func(i, j int) bool {
return strings.Compare(actual[i].String(), actual[j].String()) == -1
})

now := time.Now().Unix()
for i, e := range actual {
assert.InDelta(t, now, e.Event.Received.AsTime().Unix(), 2)
e.Event.Received = nil
if expected[i].Event == nil {
e.Event = nil
}
}

diff := cmp.Diff(
expected, actual,
protocmp.Transform(),
Expand Down

0 comments on commit 69c1a4c

Please sign in to comment.