Skip to content

Commit

Permalink
[awsemfexporter] Loosen assertion for floating point comparison. (#2826)
Browse files Browse the repository at this point in the history
Loosen comparison of floating point a bit since sometimes it's just off

**Link to tracking Issue:** Fixes #2792 

@mxiamxia Please check to see if this delta makes any sense - I noticed the flaky behavior is still quite close to 0.01, 0.0108, so it seems like it's probably OK at a glance.
  • Loading branch information
Anuraag Agrawal authored Mar 23, 2021
1 parent d42007e commit c85ae53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion exporter/awsemfexporter/datapoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ func TestIntDataPointSliceAt(t *testing.T) {
assert.Equal(t, 1, dps.Len())
dp := dps.At(0)
if strings.Contains(tc.testName, "2nd rate") {
assert.InDelta(t, expectedDP.Value.(float64), dp.Value.(float64), 0.01)
assert.InDelta(t, expectedDP.Value.(float64), dp.Value.(float64), 0.02)
} else {
assert.Equal(t, expectedDP, dp)
}
Expand Down

0 comments on commit c85ae53

Please sign in to comment.