mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
chore(tests): Attempting to fix flaxy SMTP unit test (#92786)
Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
This commit is contained in:
@@ -294,16 +294,16 @@ func TestSmtpSend(t *testing.T) {
|
||||
|
||||
count, err := client.Send(ctx, msgs...)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, 3, count)
|
||||
assert.Equal(t, 3, count)
|
||||
|
||||
// workaround for https://github.com/mocktools/go-smtp-mock/issues/181
|
||||
time.Sleep(1 * time.Millisecond)
|
||||
messages := srv.MessagesAndPurge()
|
||||
require.Len(t, messages, 3)
|
||||
assert.Len(t, messages, 3)
|
||||
|
||||
for i, sentMsg := range messages {
|
||||
rcpts := sentMsg.RcpttoRequestResponse()
|
||||
require.EqualValues(t, [][]string{
|
||||
assert.EqualValues(t, [][]string{
|
||||
{fmt.Sprintf("RCPT TO:<rcpt%d@example.com>", i+1), "250 Received"},
|
||||
}, rcpts)
|
||||
|
||||
@@ -316,7 +316,7 @@ func TestSmtpSend(t *testing.T) {
|
||||
// make sure the trace is propagated
|
||||
traceId := span.SpanContext().TraceID().String()
|
||||
hasPrefix := strings.HasPrefix(hdr.Get("traceparent"), "00-"+traceId+"-")
|
||||
require.True(t, hasPrefix)
|
||||
assert.True(t, hasPrefix)
|
||||
|
||||
// one of the lines should be the body we expect!
|
||||
found := false
|
||||
@@ -334,7 +334,7 @@ func TestSmtpSend(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
require.True(t, found)
|
||||
assert.True(t, found)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user