From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <notmuch-bounces@notmuchmail.org>
Received: from mp11.migadu.com ([2001:41d0:8:6d80::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by ms9.migadu.com with LMTPS
	id EO6BIFh+IWRAwAAASxT56A
	(envelope-from <notmuch-bounces@notmuchmail.org>)
	for <larch@yhetil.org>; Mon, 27 Mar 2023 13:30:32 +0200
Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by mp11.migadu.com with LMTPS
	id CGCLIFh+IWSvgQEA9RJhRA
	(envelope-from <notmuch-bounces@notmuchmail.org>)
	for <larch@yhetil.org>; Mon, 27 Mar 2023 13:30:32 +0200
Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::1])
	(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 2E8CC3F2BA
	for <larch@yhetil.org>; Mon, 27 Mar 2023 13:30:32 +0200 (CEST)
Received: from yantan.tethera.net (localhost [127.0.0.1])
	by mail.notmuchmail.org (Postfix) with ESMTP id 4139A5F380;
	Mon, 27 Mar 2023 11:30:29 +0000 (UTC)
Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197])
	by mail.notmuchmail.org (Postfix) with ESMTP id F1AF55F36E
	for <notmuch@notmuchmail.org>; Mon, 27 Mar 2023 11:30:25 +0000 (UTC)
Received: by fethera.tethera.net (Postfix, from userid 1001)
	id ABD0D5FB82; Mon, 27 Mar 2023 07:30:24 -0400 (EDT)
Received: (nullmailer pid 2253064 invoked by uid 1000);
	Mon, 27 Mar 2023 11:30:23 -0000
From: David Bremner <david@tethera.net>
To: Kevin Boulain <kevin@boula.in>, notmuch@notmuchmail.org
Subject: Re: [PATCH 2/2] lib/message-property: catch xapian exceptions
In-Reply-To: <20230227115617.58788-2-kevin@boula.in>
References: <20230227115617.58788-1-kevin@boula.in>
 <20230227115617.58788-2-kevin@boula.in>
Date: Mon, 27 Mar 2023 08:30:23 -0300
Message-ID: <87y1ni77ow.fsf@tethera.net>
MIME-Version: 1.0
Message-ID-Hash: NPL475XAYZLV66KU2ATVYLWNQDENHCQ4
X-Message-ID-Hash: NPL475XAYZLV66KU2ATVYLWNQDENHCQ4
X-MailFrom: david@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; digests; suspicious-header
X-Mailman-Version: 3.3.3
Precedence: list
List-Id: "Use and development of the notmuch mail system." <notmuch.notmuchmail.org>
List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
List-Owner: <mailto:notmuch-owner@notmuchmail.org>
List-Post: <mailto:notmuch@notmuchmail.org>
List-Subscribe: <mailto:notmuch-join@notmuchmail.org>
List-Unsubscribe: <mailto:notmuch-leave@notmuchmail.org>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Migadu-Country: DE
X-Migadu-Flow: FLOW_IN
ARC-Seal: i=1; s=key1; d=yhetil.org; t=1679916632; a=rsa-sha256; cv=none;
	b=ibUyxPklpXeil6iPAaLmBb+xFxmzzARiijVP4JXw95x8DKGtQ+Ck4daImPccFatA2aXkyk
	biHjQTYdar6YvMRIvMP3WLjhmICt02E7Sn2/5Txa7TyS3i2hokPbVNg1S+dT7fF9qOplUo
	oiJVJ4yr9KYbkaDi8HZFdIcvPMtZ6Vct/7FYyiDCjiqHubF2SDOJPX8VzFRTkHrWTGW0yi
	Be155gO95IeRrEMx5zMs9jJTCiIqjTjJO07FfTTbCvZJMa+mGYzPpesWPCieQkD/mD/Vwp
	62+r7XvHnUgILjdn2cLYSVjhoX23RI4zkAA/offhdFvduZFEMxn6SKcciGB86w==
ARC-Authentication-Results: i=1;
	aspmx1.migadu.com;
	dkim=none;
	dmarc=none;
	spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org;
	s=key1; t=1679916632;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to: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-owner:list-unsubscribe:list-subscribe:list-post;
	bh=97YEXttgbG3YUArwHLGfB6dhk1kARxPXyesNs9s2idk=;
	b=iCXEj+F+8AZT6ndbeNXjB/uCDgqU1+rKu2qpcU3SNu4BAIdsMoAhIS6gJhYbJt6tzlX722
	+UeLrpbEl+ZMCBFvZclu+bLgRRmI81DszTn9C5JOy7RS4Bus0JsEd2zkN095STF2dePFmD
	fdmNl/Py7ItWCrom0UAgsdyMSTciyf2+KSSZcacgIZ14F/8gbqp/rHi8gkZwTQ4g1kP/zc
	nKfR182mLDDwn4zwH8S5Mz3gU4EV+mgIOBPp6yuaazZoT5TQ7nXUQDaHexjoeSGM96UvcP
	iJgNIbDr3I40YGnd6+Twg0rtrmJTz6EzF0nYCQQVI0mcEiL10zgltyS1e33U2Q==
Authentication-Results: aspmx1.migadu.com;
	dkim=none;
	dmarc=none;
	spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org
X-Migadu-Scanner: scn1.migadu.com
X-Migadu-Spam-Score: -1.84
X-Spam-Score: -1.84
X-Migadu-Queue-Id: 2E8CC3F2BA
X-TUID: KWKUyKls6urW

Kevin Boulain <kevin@boula.in> writes:

> Since libnotmuch exposes a C interface there's no way for clients to
> diff --git a/test/T610-message-property.sh b/test/T610-message-property.sh
> index 944e1810..f7cabe4d 100755
> --- a/test/T610-message-property.sh
> +++ b/test/T610-message-property.sh
> @@ -363,7 +363,6 @@ EOF

Overall this looks good, but I think the tests are a little cryptic as written.

>  test_expect_equal_file /dev/null OUTPUT
>  
>  test_begin_subtest "edit property on removed message without uncaught exception"
> -test_subtest_known_broken
>  cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
>  EXPECT0(notmuch_database_remove_message (db, notmuch_message_get_filename (message)));
>  EXPECT0(notmuch_message_remove_property (message, "example", "example"));
> @@ -371,11 +370,11 @@ EOF
>  cat <<'EOF' >EXPECTED
>  == stdout ==
>  == stderr ==
> +line 30: 3
>  EOF
>  test_expect_equal_file EXPECTED OUTPUT

In general I think it's better if the output of a test does not change
when marked non-broken. More importantly, in this case it means that the
call to notmuch_message_remove_property is not actually returning 0 any
more. So that output is actually the EXPECT0 assertion failing. I agree
it should print something more helpful (and I understand these
assumptions are not documented). So you should probably test that the
status is not success, and ideally print the message. You can see some
examples in T560-lib-error.sh, in particular in the created file c_tail
which handles checking the error code and printing the message.