diff --git a/pkg/tests/api/alerting/api_alertmanager_test.go b/pkg/tests/api/alerting/api_alertmanager_test.go index 1e82ced07fd..1582d8d1dfd 100644 --- a/pkg/tests/api/alerting/api_alertmanager_test.go +++ b/pkg/tests/api/alerting/api_alertmanager_test.go @@ -12,11 +12,12 @@ import ( "testing" "time" - "github.com/grafana/grafana/pkg/expr" "github.com/prometheus/common/model" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/grafana/grafana/pkg/expr" + apimodels "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" ngmodels "github.com/grafana/grafana/pkg/services/ngalert/models" ngstore "github.com/grafana/grafana/pkg/services/ngalert/store" @@ -211,11 +212,11 @@ func TestIntegrationAMConfigAccess(t *testing.T) { }) t.Run("when creating silence", func(t *testing.T) { - body := ` + now := time.Now() + body := fmt.Sprintf(` { "comment": "string", "createdBy": "string", - "endsAt": "2023-03-31T14:17:04.419Z", "matchers": [ { "isRegex": true, @@ -223,9 +224,10 @@ func TestIntegrationAMConfigAccess(t *testing.T) { "value": "string" } ], - "startsAt": "2021-03-31T13:17:04.419Z" + "startsAt": "%s", + "endsAt": "%s" } - ` + `, now.Format(time.RFC3339), now.Add(10*time.Second).Format(time.RFC3339)) testCases := []testCase{ {