From 21d095b5b46651475ca5963e3670bf078f223ac5 Mon Sep 17 00:00:00 2001 From: Andreas Gkizas Date: Tue, 22 Aug 2023 12:34:30 +0300 Subject: [PATCH] Updating tests to avoid sorting of mappings --- internal/pkg/composable/providers/kubernetes/hints_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/pkg/composable/providers/kubernetes/hints_test.go b/internal/pkg/composable/providers/kubernetes/hints_test.go index dd6099b4f4a..912b01b123a 100644 --- a/internal/pkg/composable/providers/kubernetes/hints_test.go +++ b/internal/pkg/composable/providers/kubernetes/hints_test.go @@ -468,6 +468,8 @@ func TestGenerateHintsMappingWithProcessors(t *testing.T) { hintData := GetHintsMapping(mapping, logger, "co.elastic", "asdfghjkl") assert.Equal(t, expected_hints, hintData.composableMapping) - assert.Equal(t, expected_procesors, hintData.processors) + //assert.Equal(t, expected_procesors, hintData.processors). We replace this assertion with assert.Contains in order to avoid flakiness in tests because map keys are not sorted + assert.Contains(t, expected_procesors, hintData.processors[0]) + assert.Contains(t, expected_procesors, hintData.processors[1]) }