From c10b2f5125fbcf30d0378966d627978de2d57643 Mon Sep 17 00:00:00 2001 From: marcin witalis <45931826+m00g3n@users.noreply.github.com> Date: Wed, 20 Dec 2023 10:12:23 +0100 Subject: [PATCH] Update internal/controller/next_requeue_test.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: MichaƂ 'Disper' Drzewiecki --- internal/controller/next_requeue_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/controller/next_requeue_test.go b/internal/controller/next_requeue_test.go index 943ebbd8..b8a23c49 100644 --- a/internal/controller/next_requeue_test.go +++ b/internal/controller/next_requeue_test.go @@ -9,7 +9,8 @@ import ( var _ = Describe("nextRequeueAfter", func() { var ( - now = time.Now() + now = time.Now() + newYear, _ = time.Parse(time.RFC3339, "2024-01-01T00:00:01Z00:00") ) DescribeTable("should return expected values when", @@ -20,6 +21,8 @@ var _ = Describe("nextRequeueAfter", func() { Entry("receives all zero arguments", now, time.Time{}, time.Duration(0), 0.0, time.Duration(0)), Entry("receives arguments (now, zero, 1[m], 0.95)", now, time.Time{}, time.Minute, 0.95, time.Second*57), Entry("receives arguments (now, now-30[s], 1[m], 0.95)", now, now.Add(-30*time.Second), time.Minute, 0.95, time.Nanosecond*26999999999), + Entry("receives arguments (now, now-900[s], 1[m], 0.95)", now, now.Add(-900*time.Second), time.Minute, 0.95, time.Second*57), Entry("receives arguments (now, now, 1[m], 0.95)", now, now, time.Minute, 0.95, time.Second*57), + Entry("receives arguments (newYear, newYear-45[m], 1[h], 0.95)", newYear, newYear.Add(-45*time.Minute), time.Hour, 0.95, time.Nanosecond*719999999999), ) })