Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ACM-12773] Fix flaky test #1533

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions proxy/pkg/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,7 @@ func getClusterList(userMetricsAccess map[string][]string) []string {
for clusterName := range userMetricsAccess {
clusterList = append(clusterList, clusterName)
}
slices.Sort(clusterList)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would this be tripped by go1.21 update? Is there a test that asserts a sorted slice?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how this is triggered. But I ran it two times and it failed in each. I remember that go removed the random keys ordering when looping through maps, maybe this is it 🤷 . In any case, I don't think it hurts having a. consistent ordering.
There is a test that expects the cluster list to be in order. Although, it is not its purpose, but it checks the list of clusters as "c1,c2"

return clusterList
}

Expand Down