test/emacs: known broken test for matching fcc and sent message

Based on the method outlined by Daniel Kahn Gillmor in
id:87k1zm225v.fsf@fifthhorseman.net.  With a delay of 0.2 seconds the
test becomes flaky on my machine. With a 1 second delay it fails
consistently for more than 1600 iterations.
This commit is contained in:
David Bremner 2022-01-19 21:23:30 -04:00
parent b559240bb1
commit 8179c3d114

View file

@ -13,16 +13,30 @@ test_description='PGP/MIME signature verification and decryption'
test_require_emacs
add_gnupg_home
test_begin_subtest "emacs delivery of signed message"
test_begin_subtest "emacs delivery of signed message via fcc"
test_expect_success \
'emacs_fcc_message \
"test signed message 001" \
"This is a test signed message." \
"(mml-secure-message-sign)"'
test_begin_subtest "emacs delivery of signed message via fcc and smtp"
test_subtest_known_broken
emacs_deliver_message \
'signed message sent via SMTP' \
'This is a test that messages are sent via SMTP' \
"(add-hook 'message-send-mail-hook (lambda () (sleep-for 1)))
(mml-secure-message-sign)"
msg_file=$(notmuch search --output=files subject:signed-message-sent-via-SMTP)
test_expect_equal_message_body sent_message "$msg_file"
test_begin_subtest "signed part content-type indexing"
output=$(notmuch search mimetype:multipart/signed and mimetype:application/pgp-signature | notmuch_search_sanitize)
test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; test signed message 001 (inbox signed)"
notmuch search mimetype:multipart/signed and mimetype:application/pgp-signature | notmuch_search_sanitize > OUTPUT
cat <<EOF >EXPECTED
thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; test signed message 001 (inbox signed)
thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; signed message sent via SMTP (inbox signed)
EOF
test_expect_equal_file EXPECTED OUTPUT
test_begin_subtest "signature verification"
output=$(notmuch show --format=json --verify subject:"test signed message 001" \