X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=test%2FT590-thread-breakage.sh;h=38abc2113c269cc328417312629789054b2d863d;hp=2f838b39b215d33dabf4b146f7889ccf8ce3eea4;hb=5f71a4d3e15fa2ff7d4bcc9b8bfb8a2057b26ad7;hpb=92559ee3473381b0ba207ddb7db944d6ffadc2db diff --git a/test/T590-thread-breakage.sh b/test/T590-thread-breakage.sh index 2f838b39..38abc211 100755 --- a/test/T590-thread-breakage.sh +++ b/test/T590-thread-breakage.sh @@ -3,21 +3,21 @@ # Copyright (c) 2016 Daniel Kahn Gillmor # -test_description='thread breakage during reindexing +test_description='thread breakage during reindexing' -notmuch uses ghost documents to track messages we have seen references -to but have never seen. Regardless of the order of delivery, message -deletion, and reindexing, the list of ghost messages for a given -stored corpus should not vary, so that threads can be reassmebled -cleanly. - -In practice, we accept a small amount of variation (and therefore -traffic pattern metadata leakage to be stored in the index) for the -sake of efficiency. - -This test also embeds some subtests to ensure that indexing actually -works properly and attempted fixes to threading issues do not break -the expected contents of the index.' +# notmuch uses ghost documents to track messages we have seen references +# to but have never seen. Regardless of the order of delivery, message +# deletion, and reindexing, the list of ghost messages for a given +# stored corpus should not vary, so that threads can be reassmebled +# cleanly. +# +# In practice, we accept a small amount of variation (and therefore +# traffic pattern metadata leakage to be stored in the index) for the +# sake of efficiency. +# +# This test also embeds some subtests to ensure that indexing actually +# works properly and attempted fixes to threading issues do not break +# the expected contents of the index. . ./test-lib.sh || exit 1 @@ -94,20 +94,11 @@ notmuch new >/dev/null test_thread_count 1 'First message removed: still only one thread' test_content_count apple 0 test_content_count banana 1 -test_begin_subtest 'should be one ghost after first message removed' -test_subtest_known_broken -ghosts=$(../ghost-report ${MAIL_DIR}/.notmuch/xapian) -test_expect_equal "$ghosts" "1" +test_ghost_count 1 'should be one ghost after first message removed' message_a notmuch new >/dev/null -# this is known to fail (it shows 2 threads) because no "ghost -# message" was created for message A when it was removed from the -# index, despite message B still pointing to it. -test_begin_subtest 'First message reappears: should return to the same thread' -test_subtest_known_broken -count=$(notmuch count --output=threads) -test_expect_equal "$count" "1" +test_thread_count 1 'First message reappears: should return to the same thread' test_content_count apple 1 test_content_count banana 1 test_ghost_count 0 @@ -117,13 +108,17 @@ notmuch new >/dev/null test_thread_count 1 'Removing second message: still only one thread' test_content_count apple 1 test_content_count banana 0 -test_ghost_count 0 'No ghosts should remain after deletion of second message' +test_begin_subtest 'No ghosts should remain after deletion of second message' +# this is known to fail; we are leaking ghost messages deliberately +test_subtest_known_broken +ghosts=$(../ghost-report ${MAIL_DIR}/.notmuch/xapian) +test_expect_equal "$ghosts" "0" rm -f ${MAIL_DIR}/cur/a notmuch new >/dev/null test_thread_count 0 'All messages gone: no threads' test_content_count apple 0 test_content_count banana 0 -test_ghost_count 0 +test_ghost_count 0 'No ghosts should remain after full thread deletion' test_done