From: David Bremner Date: Mon, 29 Sep 2014 19:49:32 +0000 (+0200) Subject: [PATCH] WIP: new insert tests for failing indexing. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=37a68d89429aeb3538f9251567fc8878b7f58e80;p=notmuch-archives.git [PATCH] WIP: new insert tests for failing indexing. --- diff --git a/ca/9cca9aa6b97eba1d684817285b217fe46c3432 b/ca/9cca9aa6b97eba1d684817285b217fe46c3432 new file mode 100644 index 000000000..9b6aa5d0e --- /dev/null +++ b/ca/9cca9aa6b97eba1d684817285b217fe46c3432 @@ -0,0 +1,97 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 03CFE431FD7 + for ; Mon, 29 Sep 2014 12:49:51 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id BoXQFKEx3oHD for ; + Mon, 29 Sep 2014 12:49:46 -0700 (PDT) +Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155]) + (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id A6CA7431FD2 + for ; Mon, 29 Sep 2014 12:49:46 -0700 (PDT) +Received: from remotemail by yantan.tethera.net with local (Exim 4.80) + (envelope-from ) + id 1XYgx6-000326-BZ; Mon, 29 Sep 2014 16:49:44 -0300 +Received: (nullmailer pid 17559 invoked by uid 1000); Mon, 29 Sep 2014 + 19:49:35 -0000 +From: David Bremner +To: notmuch@notmuchmail.org +Subject: [PATCH] WIP: new insert tests for failing indexing. +Date: Mon, 29 Sep 2014 21:49:32 +0200 +Message-Id: <1412020172-17193-1-git-send-email-david@tethera.net> +X-Mailer: git-send-email 2.1.0 +In-Reply-To: +References: +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Mon, 29 Sep 2014 19:49:51 -0000 + +The second one fails because the initial write lock fails. +I guess this is maybe a doc bug. +--- + test/T070-insert.sh | 21 +++++++++++++++++++++ + 1 file changed, 21 insertions(+) + +This is what I came up with when trying to induce indexing +failure. The best I could do was make the initial notmuch open fail. +This means my second test is broken. When I was writing the commit +message I was thinking the man page was therefore wrong, but actually +it's ok. + +I did wonder if it might be a good idea to move the database open +after the message is written to disk, is we want to maximize the +chance of insert --keep "succeeding". + +diff --git a/test/T070-insert.sh b/test/T070-insert.sh +index aacc643..e7d0ae1 100755 +--- a/test/T070-insert.sh ++++ b/test/T070-insert.sh +@@ -183,4 +183,25 @@ test_expect_code 1 "Invalid tags set exit code" \ + + notmuch config set new.tags $OLDCONFIG + ++ ++gen_insert_msg ++test_python <&1' ++ ++test_expect_code 0 "Zero exit code due to --keep flag" \ ++ 'notmuch insert --keep < "$gen_msg_filename" 2>&1' ++ ++kill $(cat ${TMP_DIRECTORY}/write-locker.pid) >/dev/null 2>&1 ++ + test_done +-- +2.1.0 +