fix(alertmanager): fix a flaky test (#7123)

This commit is contained in:
Vibhu Pandey 2025-02-16 19:02:33 +05:30 committed by GitHub
parent 042f31116a
commit a6cfb63036
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

2
go.mod
View File

@ -20,6 +20,7 @@ require (
github.com/go-co-op/gocron v1.30.1 github.com/go-co-op/gocron v1.30.1
github.com/go-kit/log v0.2.1 github.com/go-kit/log v0.2.1
github.com/go-openapi/runtime v0.28.0 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/redis/v8 v8.11.5
github.com/go-redis/redismock/v8 v8.11.5 github.com/go-redis/redismock/v8 v8.11.5
github.com/go-viper/mapstructure/v2 v2.1.0 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/jsonreference v0.21.0 // indirect
github.com/go-openapi/loads v0.22.0 // indirect github.com/go-openapi/loads v0.22.0 // indirect
github.com/go-openapi/spec v0.21.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/swag v0.23.0 // indirect
github.com/go-openapi/validate v0.24.0 // indirect github.com/go-openapi/validate v0.24.0 // indirect
github.com/goccy/go-json v0.10.3 // indirect github.com/goccy/go-json v0.10.3 // indirect

View File

@ -180,11 +180,11 @@ func TestNewConfigFromChannels(t *testing.T) {
routes, err := json.Marshal(c.alertmanagerConfig.Route.Routes) routes, err := json.Marshal(c.alertmanagerConfig.Route.Routes)
assert.NoError(t, err) 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) receivers, err := json.Marshal(c.alertmanagerConfig.Receivers)
assert.NoError(t, err) assert.NoError(t, err)
assert.Equal(t, tc.expectedReceivers, string(receivers)) assert.JSONEq(t, tc.expectedReceivers, string(receivers))
}) })
} }
} }