Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions exporter/elasticsearchexporter/internal/lru/lruset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ func TestLRUSetLifeTime(t *testing.T) {
})
require.NoError(tt, err)
assert.False(tt, val)
}, lifetime*2, lifetime/10)
assert.GreaterOrEqual(t, time.Since(timeSet), lifetime)
}, lifetime*2, lifetime/100) // tick is kept at 1% of lifetime
// Assert with epsilon to somewhat account for NTP adjustments.
// Also see: https://github.com/elastic/go-freelru/issues/1
assert.InEpsilon(t, lifetime, time.Since(timeSet), 0.015) // epsilon is kept at 1.5%
}

func BenchmarkLRUSetCheck(b *testing.B) {
Expand Down