Skip to content

Commit de97dd5

Browse files
committed
Fixes from Cursor review.
1 parent a6e1c78 commit de97dd5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pkg/mimirpb/custom_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ func TestInstrumentRefLeaks(t *testing.T) {
274274
}()
275275

276276
// Expect to receive a leak detection.
277-
require.Eventually(t, func() bool { return <-leaks }, 10*time.Millisecond, 1*time.Second, "expected a reference leak")
277+
require.Eventually(t, func() bool { return <-leaks }, 1*time.Second, 10*time.Millisecond, "expected a reference leak")
278278
// Expect the label name contents to have been replaced with a taint word.
279279
// Keep this check last, because we need to extend the lifespan of leakingLabelName
280280
// to avoid Go optimizing the leak away.
@@ -289,5 +289,5 @@ func TestInstrumentRefLeaks(t *testing.T) {
289289
leaks = internal.NextRefLeakCheck(t.Context(), reqNoLeak.Buffer().ReadOnlyData())
290290
reqNoLeak.FreeBuffer()
291291
}()
292-
require.Eventually(t, func() bool { return !<-leaks }, 10*time.Millisecond, 1*time.Second, "expected no reference leaks")
292+
require.Eventually(t, func() bool { return !<-leaks }, 1*time.Second, 10*time.Millisecond, "expected no reference leaks")
293293
}

pkg/mimirpb/internal/refleaks.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ func NextRefLeakCheck(ctx context.Context, object any) <-chan bool {
4343
return
4444
}
4545
case <-ctx.Done():
46+
return
4647
}
4748
}
4849
}()

0 commit comments

Comments
 (0)