test(inputs.statsd): increase sleep + expiration on test (#12354)

This commit is contained in:
Joshua Powers 2022-12-09 12:55:10 -07:00 committed by GitHub
parent 9b33b95bc0
commit 4f7717b4fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1032,7 +1032,7 @@ 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"))
@ -1040,7 +1040,7 @@ func TestCachesExpireAfterMaxTTL(t *testing.T) {
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.