From b79350abba9abbcb62e7ea6f7949e693c62c2b1f Mon Sep 17 00:00:00 2001 From: vnxme <46669194+vnxme@users.noreply.github.com> Date: Wed, 7 Aug 2024 16:27:47 +0300 Subject: [PATCH] clock: fix tests in non-UTC timezones (#230) --- modules/l4clock/matcher_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/l4clock/matcher_test.go b/modules/l4clock/matcher_test.go index c889664..ad6b57f 100644 --- a/modules/l4clock/matcher_test.go +++ b/modules/l4clock/matcher_test.go @@ -41,8 +41,8 @@ func Test_MatchClock_Match(t *testing.T) { shouldMatch bool } - tNowMinus5Minutes := time.Now().Add(time.Minute * 5 * (-1)).Format(time.TimeOnly) - tNowPlus5Minutes := time.Now().Add(time.Minute * 5).Format(time.TimeOnly) + tNowMinus5Minutes := time.Now().UTC().Add(time.Minute * 5 * (-1)).Format(time.TimeOnly) + tNowPlus5Minutes := time.Now().UTC().Add(time.Minute * 5).Format(time.TimeOnly) tests := []test{ {matcher: &MatchClock{}, data: []byte{}, shouldMatch: true},