From ca489d59e9b09ff129026db2472a3f4853d8557e Mon Sep 17 00:00:00 2001 From: ritalwar Date: Sat, 21 Oct 2023 23:27:02 +0530 Subject: [PATCH] Fix test cases --- .../metricbeat/module/statsd/server/data_test.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/x-pack/metricbeat/module/statsd/server/data_test.go b/x-pack/metricbeat/module/statsd/server/data_test.go index 9b25499316be..f0502e4cd997 100644 --- a/x-pack/metricbeat/module/statsd/server/data_test.go +++ b/x-pack/metricbeat/module/statsd/server/data_test.go @@ -1130,7 +1130,7 @@ func TestTagsGrouping(t *testing.T) { require.NoError(t, err) events := ms.getEvents() - assert.Len(t, events, 2) + assert.Len(t, events, 4) actualTags := []mapstr.M{} for _, e := range events { @@ -1144,6 +1144,18 @@ func TestTagsGrouping(t *testing.T) { "k2": "v2", }, }, + { + "labels": mapstr.M{ + "k1": "v1", + "k2": "v2", + }, + }, + { + "labels": mapstr.M{ + "k1": "v2", + "k2": "v3", + }, + }, { "labels": mapstr.M{ "k1": "v2", @@ -1222,7 +1234,7 @@ func TestData(t *testing.T) { require.NoError(t, err) events := ms.getEvents() - assert.Len(t, events, 1) + assert.Len(t, events, 10) mbevent := mbtest.StandardizeEvent(ms, *events[0]) mbtest.WriteEventToDataJSON(t, mbevent, "")