Skip to content

Commit 38f1378

Browse files
authored
Fix flake in TestLatestWorkflowRuns (#822)
This asserts that two slices match, but the order of values in the slices depends on map iteration.
1 parent 9e5f2ff commit 38f1378

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pull/github_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -638,9 +638,9 @@ func TestLatestWorkflowRuns(t *testing.T) {
638638
require.NoError(t, err)
639639

640640
assert.Len(t, runs, 3, "incorrect number of workflow runs")
641-
assert.Equal(t, runs[".github/workflows/a.yml"], []string{"success", "skipped"}, "incorrect conclusion for workflow run a")
642-
assert.Equal(t, runs[".github/workflows/b.yml"], []string{"failure"}, "incorrect conclusion for workflow run b")
643-
assert.Equal(t, runs[".github/workflows/c.yml"], []string{"cancelled"}, "incorrect conclusion for workflow run c")
641+
assert.ElementsMatch(t, runs[".github/workflows/a.yml"], []string{"success", "skipped"}, "incorrect conclusion for workflow run a")
642+
assert.ElementsMatch(t, runs[".github/workflows/b.yml"], []string{"failure"}, "incorrect conclusion for workflow run b")
643+
assert.ElementsMatch(t, runs[".github/workflows/c.yml"], []string{"cancelled"}, "incorrect conclusion for workflow run c")
644644
assert.Equal(t, 2, runsRule.Count, "incorrect http request count")
645645
}
646646

0 commit comments

Comments
 (0)