mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Fix flake on test receiver tests (#38511)
* Alerting: Fix flake on test receiver tests * Make the actual result from the API be sorted * Use the correct letters
This commit is contained in:
parent
6e639f3c72
commit
2f27a5240b
@ -5,6 +5,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/url"
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
apimodels "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
|
||||
@ -126,6 +127,12 @@ func (am *Alertmanager) TestReceivers(ctx context.Context, c apimodels.TestRecei
|
||||
for _, next := range m {
|
||||
v.Receivers = append(v.Receivers, next)
|
||||
}
|
||||
|
||||
// Make sure the return order is deterministic.
|
||||
sort.Slice(v.Receivers, func(i, j int) bool {
|
||||
return v.Receivers[i].Name < v.Receivers[j].Name
|
||||
})
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user