chore(tests): fix flaky SMTP test (#93031)
This commit is contained in:
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user