From 1f9657106bea19e78f289ebe40e11025fe09bb34 Mon Sep 17 00:00:00 2001 From: Agniva De Sarker Date: Wed, 18 May 2022 18:53:41 +0530 Subject: [PATCH] MM-31353: Fix flaky TestNoticeValidation/notice_with_specific_date_check (#20238) We now generate the current time in UTC to avoid date transitions when running the tests at different local times. https://mattermost.atlassian.net/browse/MM-31353 ```release-note NONE ``` --- app/product_notices_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/product_notices_test.go b/app/product_notices_test.go index 8403634dc5..8fe49db619 100644 --- a/app/product_notices_test.go +++ b/app/product_notices_test.go @@ -360,7 +360,7 @@ func TestNoticeValidation(t *testing.T) { args: args{ notice: &model.ProductNotice{ Conditions: model.Conditions{ - DisplayDate: model.NewString(fmt.Sprintf("= %sT00:00:00Z", time.Now().Format("2006-01-02"))), + DisplayDate: model.NewString(fmt.Sprintf("= %sT00:00:00Z", time.Now().UTC().Format("2006-01-02"))), }, }, },