Skip to content

Commit

Permalink
Update internal/controller/next_requeue_test.go
Browse files Browse the repository at this point in the history
Co-authored-by: Michał 'Disper' Drzewiecki <michal.drzewiecki@sap.com>
  • Loading branch information
m00g3n and Disper authored Dec 20, 2023
1 parent eb16be9 commit c10b2f5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/controller/next_requeue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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),
)
})

0 comments on commit c10b2f5

Please sign in to comment.