Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

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

Vibhu Pandeya6cfb6303659
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))
})
}
}