Maintenance: Not yet arrived email in inbox of email integration tests causes flaky results on CI.
This commit is contained in:
parent
585bc5e0ea
commit
2db2f3407d
2 changed files with 12 additions and 3 deletions
|
@ -887,7 +887,7 @@ process unprocessable_mails (tmp/unprocessable_mail/*.eml) again
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
Rails.logger.error "Send mail too large postmaster message to: #{reply_mail[:to]}"
|
Rails.logger.info "Send mail too large postmaster message to: #{reply_mail[:to]}"
|
||||||
reply_mail[:from] = EmailAddress.find_by(channel: channel).email
|
reply_mail[:from] = EmailAddress.find_by(channel: channel).email
|
||||||
channel.deliver(reply_mail)
|
channel.deliver(reply_mail)
|
||||||
rescue => e
|
rescue => e
|
||||||
|
|
|
@ -116,8 +116,17 @@ Oversized Email Message Body #{'#' * 120_000}
|
||||||
assert_equal(large_message, eml_data)
|
assert_equal(large_message, eml_data)
|
||||||
|
|
||||||
# 2. verify that a postmaster response email has been sent to the sender
|
# 2. verify that a postmaster response email has been sent to the sender
|
||||||
|
message_ids = nil
|
||||||
|
5.times do |sleep_offset|
|
||||||
imap.select('inbox')
|
imap.select('inbox')
|
||||||
message_ids = imap.sort(['DATE'], ['ALL'], 'US-ASCII')
|
message_ids = imap.sort(['DATE'], ['ALL'], 'US-ASCII')
|
||||||
|
|
||||||
|
break if message_ids.count.positive?
|
||||||
|
|
||||||
|
# send mail hasn't arrived yet in the inbox
|
||||||
|
sleep sleep_offset
|
||||||
|
end
|
||||||
|
|
||||||
assert(message_ids.count.positive?, 'Must have received a reply from the postmaster')
|
assert(message_ids.count.positive?, 'Must have received a reply from the postmaster')
|
||||||
imap_message_id = message_ids.last
|
imap_message_id = message_ids.last
|
||||||
msg = imap.fetch(imap_message_id, 'RFC822')[0].attr['RFC822']
|
msg = imap.fetch(imap_message_id, 'RFC822')[0].attr['RFC822']
|
||||||
|
|
Loading…
Reference in a new issue