From 648e0bc660eba29bb472264e5dbbdefe39e2e315 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Philippe=20Qu=C3=A9m=C3=A9ner?= Date: Fri, 16 May 2025 13:47:09 +0200 Subject: [PATCH] fix(util): flaky debouncer test (#105541) --- pkg/util/debouncer/debouncer_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/util/debouncer/debouncer_test.go b/pkg/util/debouncer/debouncer_test.go index 8fd58efddc9..bf0874c8f72 100644 --- a/pkg/util/debouncer/debouncer_test.go +++ b/pkg/util/debouncer/debouncer_test.go @@ -83,7 +83,8 @@ func TestDebouncer(t *testing.T) { } } - require.WithinDuration(t, start.Add(time.Millisecond*500), clockMock.Now(), time.Millisecond*100) + // Make sure that the execution happened after the maxTimeout of 500ms, but before the next MaxTimeout. + require.WithinDuration(t, start.Add(time.Millisecond*500), clockMock.Now(), time.Millisecond*499) }) t.Run("should handle buffer full", func(t *testing.T) {