test: fix flaky test

A race condition in TestSendSamplesWithBackoffWithSampleAgeLimit was
observed in CI where the sample age limit was too close to the backoff
time, causing samples to be dropped intermittently. Increasing the
SampleAgeLimit resolves the problem.

Signed-off-by: Adam Bernot <bernot@google.com>
This commit is contained in:
Adam Bernot 2025-08-15 18:56:19 +00:00
parent 8cf67d99ba
commit 575a60ec92
No known key found for this signature in database
GPG Key ID: 161B8FFD23B23A81
1 changed files with 1 additions and 1 deletions

View File

@ -2003,7 +2003,7 @@ func TestIsSampleOld(t *testing.T) {
func TestSendSamplesWithBackoffWithSampleAgeLimit(t *testing.T) { func TestSendSamplesWithBackoffWithSampleAgeLimit(t *testing.T) {
t.Parallel() t.Parallel()
maxSamplesPerSend := 10 maxSamplesPerSend := 10
sampleAgeLimit := time.Second sampleAgeLimit := time.Second * 2
cfg := config.DefaultQueueConfig cfg := config.DefaultQueueConfig
cfg.MaxShards = 1 cfg.MaxShards = 1