From 38f137808b413deef167528016985c794356762c Mon Sep 17 00:00:00 2001 From: Billy Keyes Date: Thu, 15 Aug 2024 13:50:36 -0400 Subject: [PATCH] Fix flake in TestLatestWorkflowRuns (#822) This asserts that two slices match, but the order of values in the slices depends on map iteration. --- pull/github_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pull/github_test.go b/pull/github_test.go index 29a1d8da..1e77d4fa 100644 --- a/pull/github_test.go +++ b/pull/github_test.go @@ -638,9 +638,9 @@ func TestLatestWorkflowRuns(t *testing.T) { require.NoError(t, err) assert.Len(t, runs, 3, "incorrect number of workflow runs") - assert.Equal(t, runs[".github/workflows/a.yml"], []string{"success", "skipped"}, "incorrect conclusion for workflow run a") - assert.Equal(t, runs[".github/workflows/b.yml"], []string{"failure"}, "incorrect conclusion for workflow run b") - assert.Equal(t, runs[".github/workflows/c.yml"], []string{"cancelled"}, "incorrect conclusion for workflow run c") + assert.ElementsMatch(t, runs[".github/workflows/a.yml"], []string{"success", "skipped"}, "incorrect conclusion for workflow run a") + assert.ElementsMatch(t, runs[".github/workflows/b.yml"], []string{"failure"}, "incorrect conclusion for workflow run b") + assert.ElementsMatch(t, runs[".github/workflows/c.yml"], []string{"cancelled"}, "incorrect conclusion for workflow run c") assert.Equal(t, 2, runsRule.Count, "incorrect http request count") }