From 45236e23d693dd36fe1063bc062758890b54af1c Mon Sep 17 00:00:00 2001 From: Roberto Dip Date: Wed, 18 Oct 2023 11:07:00 -0300 Subject: [PATCH] fix flaky test by ignoring order of elements (#14611) As far as I can tell, the order doesn't matter here, we wan to test that the slice has the elements with the higher `UnixTime` value --- server/service/osquery_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/service/osquery_test.go b/server/service/osquery_test.go index 66c5832ef0..abc58d72ae 100644 --- a/server/service/osquery_test.go +++ b/server/service/osquery_test.go @@ -818,7 +818,7 @@ func TestGetMostRecentResults(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { results := getMostRecentResults(tt.input) - assert.Equal(t, tt.expected, results) + assert.ElementsMatch(t, tt.expected, results) }) } }