mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
chore(tests): fix flaky SMTP test (#93031)
This commit is contained in:
parent
8ea374b773
commit
a45ec2670d
@ -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{
|
||||
|
Loading…
Reference in New Issue
Block a user