From a6cfb63036597c446c0821f50add45f64b4a6021 Mon Sep 17 00:00:00 2001 From: Vibhu Pandey Date: Sun, 16 Feb 2025 19:02:33 +0530 Subject: [PATCH] fix(alertmanager): fix a flaky test (#7123) --- go.mod | 2 +- pkg/types/alertmanagertypes/channel_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 7819a521c9..080da0822b 100644 --- a/go.mod +++ b/go.mod @@ -20,6 +20,7 @@ require ( github.com/go-co-op/gocron v1.30.1 github.com/go-kit/log v0.2.1 github.com/go-openapi/runtime v0.28.0 + github.com/go-openapi/strfmt v0.23.0 github.com/go-redis/redis/v8 v8.11.5 github.com/go-redis/redismock/v8 v8.11.5 github.com/go-viper/mapstructure/v2 v2.1.0 @@ -126,7 +127,6 @@ require ( github.com/go-openapi/jsonreference v0.21.0 // indirect github.com/go-openapi/loads v0.22.0 // indirect github.com/go-openapi/spec v0.21.0 // indirect - github.com/go-openapi/strfmt v0.23.0 // indirect github.com/go-openapi/swag v0.23.0 // indirect github.com/go-openapi/validate v0.24.0 // indirect github.com/goccy/go-json v0.10.3 // indirect diff --git a/pkg/types/alertmanagertypes/channel_test.go b/pkg/types/alertmanagertypes/channel_test.go index d7131c449e..1e44a5fe25 100644 --- a/pkg/types/alertmanagertypes/channel_test.go +++ b/pkg/types/alertmanagertypes/channel_test.go @@ -180,11 +180,11 @@ func TestNewConfigFromChannels(t *testing.T) { routes, err := json.Marshal(c.alertmanagerConfig.Route.Routes) assert.NoError(t, err) - assert.Equal(t, tc.expectedRoutes, string(routes)) + assert.JSONEq(t, tc.expectedRoutes, string(routes)) receivers, err := json.Marshal(c.alertmanagerConfig.Receivers) assert.NoError(t, err) - assert.Equal(t, tc.expectedReceivers, string(receivers)) + assert.JSONEq(t, tc.expectedReceivers, string(receivers)) }) } }