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 ms0.migadu.com with LMTPS id SNn6C5dcqGAdBAAAgWs5BA (envelope-from ) for ; Sat, 22 May 2021 03:21:27 +0200 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 WGquB5dcqGD3NQAAB5/wlQ (envelope-from ) for ; Sat, 22 May 2021 01:21:27 +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) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id DAAAD1CD65 for ; Sat, 22 May 2021 03:21:26 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 13ED229057; Fri, 21 May 2021 21:21:01 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id E067A271E8 for ; Fri, 21 May 2021 21:20:53 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id D859D5FD25; Fri, 21 May 2021 21:20:53 -0400 (EDT) Received: (nullmailer pid 1412731 invoked by uid 1000); Sat, 22 May 2021 01:20:48 -0000 From: David Bremner To: notmuch@notmuchmail.org Cc: David Bremner Subject: [PATCH 3/5] test: add known broken test for closing with open transaction Date: Fri, 21 May 2021 22:20:38 -0300 Message-Id: <20210522012040.1412467-4-david@tethera.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210522012040.1412467-1-david@tethera.net> References: <20210522012040.1412467-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: WJCYJ46VKXGTSBRIETUWUZ2G4YWVOVUS X-Message-ID-Hash: WJCYJ46VKXGTSBRIETUWUZ2G4YWVOVUS 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-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1621646487; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=6S6oYeW9uKnTV2Ok5a0CNX+wuxpyo2MosufiPIpX9gY=; b=JIukK65zkJlFSgbJafeLQ2NoG1UFB8arRQyS3/up70YS7Bs0HYXetqWTMkg9N24TtK986x zzj4mNLn/7mRozo0GEy3G717KBmBRjMRgxju8d8vOUxwEP3alaLISnmomP2Nv/JAqbjfy9 vFBRQTaJA+uj5qFkiFg8DC5kROxiE8zWhaNQnuYTf9EnePR+F+z0QOQg4Bkvipino/iRja Aw4lX6nvzJm7lWvq+qWvPTZiIzGfs/5nDSFThdf+T2i3nZfd5ISogRLiNPm7cAblMgwZ6v Nce7QJRi+UE1cgUoQPOWESJrryqptucC3WHgbVukrtumgErZpJ6UZwIWX18Y6A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1621646487; a=rsa-sha256; cv=none; b=Nkaa404v/L+xVJXD+5K3xVMk4O1XyOvS6fU4VpCy0EGyL326gSvuk2TvcNP7ewdOJ0FIwh 0E/uSYL3QlozPzqdoA0qWaQLGNGGxCuS8zZJjLNcruipKijF+RZoACJkUJGci7tS1lxxO4 Te3ioAo7tT4lGPsTvQI5nF79BPqM9GgbVsm2kEe1KV+aNS+xIFwju7u27sanPLOlsWCSHb fPuufdDL/njqgHBIuZa01ZAIr5lKbFVN9aT+s/NpS8hISHNNHBNY8QsPTKQqgUNTMWxFyQ 1xDwFqTOdPO0B+e9VY5FJi0UINwQh/UX4uZoTP3wIuQmb44MMb3ppLmd6UjT6g== ARC-Authentication-Results: i=1; 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-Migadu-Spam-Score: -1.07 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-Migadu-Queue-Id: DAAAD1CD65 X-Spam-Score: -1.07 X-Migadu-Scanner: scn0.migadu.com X-TUID: MT4ZasKLZB9G The expected output may need adjusting, but what is clear is that saving none of the changes is not desirable. --- test/T385-transactions.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 test/T385-transactions.sh diff --git a/test/T385-transactions.sh b/test/T385-transactions.sh new file mode 100755 index 00000000..ebfec2ed --- /dev/null +++ b/test/T385-transactions.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +test_description='transactions' +. $(dirname "$0")/test-lib.sh || exit 1 + +make_shim no-close < +#include +notmuch_status_t +notmuch_database_close (notmuch_database_t *notmuch) +{ + return notmuch_database_begin_atomic (notmuch); +} +EOF + +for i in `seq 1 1024` +do + generate_message '[subject]="'"subject $i"'"' \ + '[body]="'"body $i"'"' +done + +test_begin_subtest "initial new" +NOTMUCH_NEW > OUTPUT +cat < EXPECTED +Added 1024 new messages to the database. +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Some changes saved with open transaction" +test_subtest_known_broken +notmuch config set database.autocommit 1000 +rm -r ${MAIL_DIR}/.notmuch +notmuch_with_shim no-close new +output=$(notmuch count '*') +test_expect_equal "$output" "1000" + +test_done -- 2.30.2