diff --git a/pkg/services/notifications/smtp_test.go b/pkg/services/notifications/smtp_test.go index e55bcd50639..78e9d76e454 100644 --- a/pkg/services/notifications/smtp_test.go +++ b/pkg/services/notifications/smtp_test.go @@ -8,6 +8,7 @@ import ( "fmt" "io" "net/textproto" + "sort" "strings" "testing" "time" @@ -301,6 +302,11 @@ func TestSmtpSend(t *testing.T) { messages := srv.MessagesAndPurge() assert.Len(t, messages, 3) + // sort for test consistency + sort.Slice(messages, func(i, j int) bool { + return messages[i].RcpttoRequestResponse()[0][0] < messages[j].RcpttoRequestResponse()[0][0] + }) + for i, sentMsg := range messages { rcpts := sentMsg.RcpttoRequestResponse() assert.EqualValues(t, [][]string{