From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id KNn4HvwlHl8HagAA0tVLHw (envelope-from ) for ; Mon, 27 Jul 2020 00:55:24 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 232+GvwlHl/gDQAAB5/wlQ (envelope-from ) for ; Mon, 27 Jul 2020 00:55:24 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1DED59404D9 for ; Mon, 27 Jul 2020 00:55:22 +0000 (UTC) Received: from [144.217.243.247] (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id B8D4927BCD; Sun, 26 Jul 2020 20:55:15 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id BE2091FA22 for ; Sun, 26 Jul 2020 20:55:12 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id 9A6A660AB8; Sun, 26 Jul 2020 20:55:12 -0400 (EDT) Received: (nullmailer pid 141905 invoked by uid 1000); Mon, 27 Jul 2020 00:55:10 -0000 From: David Bremner To: David Bremner , notmuch@notmuchmail.org Subject: [PATCH 1/2] test: known broken test for n_directory_delete with closed db. Date: Sun, 26 Jul 2020 21:55:06 -0300 Message-Id: <20200727005507.141831-1-david@tethera.net> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200726115931.1448056-9-david@tethera.net> References: <20200726115931.1448056-9-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: CJ7YM7P4QBUXSLQERNXQ5F3OQEUAD2HE X-Message-ID-Hash: CJ7YM7P4QBUXSLQERNXQ5F3OQEUAD2HE X-MailFrom: bremner@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Spam-Score: 1.53 X-TUID: LHuhdNgLW/5k There is a return value bug in notmuch_directory_delete that is hiding the exception. --- Well that was embarrassing. Silly bug in notmuch code, nothing to do with Xapian. test/T563-lib-directory.sh | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/test/T563-lib-directory.sh b/test/T563-lib-directory.sh index 739469a6..8777f62b 100755 --- a/test/T563-lib-directory.sh +++ b/test/T563-lib-directory.sh @@ -26,7 +26,7 @@ int main (int argc, char** argv) exit (1); } - EXPECT0(notmuch_database_get_directory (db, "", &dir)); + EXPECT0(notmuch_database_get_directory (db, "bar", &dir)); EXPECT0(notmuch_database_close (db)); EOF @@ -74,4 +74,40 @@ A Xapian exception occurred at lib/directory.cc:XXX: Database has been closed EOF test_expect_equal_file EXPECTED OUTPUT +backup_database +test_begin_subtest "delete directory document for a closed db" +test_subtest_known_broken +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} + { + stat = notmuch_directory_delete (dir); + printf ("%d\n", stat == NOTMUCH_STATUS_XAPIAN_EXCEPTION); + } +EOF +cat < EXPECTED +== stdout == +1 +== stderr == +A Xapian exception occurred deleting directory entry: Database has been closed. +EOF +test_expect_equal_file EXPECTED OUTPUT +restore_database + +backup_database +test_begin_subtest "get/set mtime of directory for a closed db" +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} + { + time_t stamp = notmuch_directory_get_mtime (dir); + stat = notmuch_directory_set_mtime (dir, stamp); + printf ("%d\n", stat == NOTMUCH_STATUS_XAPIAN_EXCEPTION); + } +EOF +cat < EXPECTED +== stdout == +1 +== stderr == +A Xapian exception occurred setting directory mtime: Database has been closed. +EOF +test_expect_equal_file EXPECTED OUTPUT +restore_database + test_done -- 2.27.0