Skip to content

Commit

Permalink
test(inputs.statsd): increase sleep + expiration on test (#12354)
Browse files Browse the repository at this point in the history
  • Loading branch information
powersj authored Dec 9, 2022
1 parent 9b33b95 commit 4f7717b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/inputs/statsd/statsd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1032,15 +1032,15 @@ func TestParse_MeasurementsWithSameName(t *testing.T) {
// Test that the metric caches expire (clear) an entry after the entry hasn't been updated for the configurable MaxTTL duration.
func TestCachesExpireAfterMaxTTL(t *testing.T) {
s := NewTestStatsd()
s.MaxTTL = config.Duration(100 * time.Microsecond)
s.MaxTTL = config.Duration(10 * time.Millisecond)

acc := &testutil.Accumulator{}
require.NoError(t, s.parseStatsdLine("valid:45|c"))
require.NoError(t, s.parseStatsdLine("valid:45|c"))
require.NoError(t, s.Gather(acc))

// Max TTL goes by, our 'valid' entry is cleared.
time.Sleep(100 * time.Microsecond)
time.Sleep(100 * time.Millisecond)
require.NoError(t, s.Gather(acc))

// Now when we gather, we should have a counter that is reset to zero.
Expand Down

0 comments on commit 4f7717b

Please sign in to comment.