From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id UNZfAQUCd2GiuwAAgWs5BA (envelope-from ) for ; Mon, 25 Oct 2021 21:14:13 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 8GN4OAQCd2GvJgAAbx9fmQ (envelope-from ) for ; Mon, 25 Oct 2021 19:14:12 +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 235B7178DA for ; Mon, 25 Oct 2021 21:14:12 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 59F581F532; Mon, 25 Oct 2021 15:14:08 -0400 (EDT) Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [IPv6:2a0b:5c81:1c1::37]) by mail.notmuchmail.org (Postfix) with ESMTPS id 1427F1F52F for ; Mon, 25 Oct 2021 15:14:05 -0400 (EDT) Received: from guru.guru-group.fi (unknown [IPv6:2a02:2380:1:9:5054:ff:feb7:a4bc]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: too) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 652EC1B0009C; Mon, 25 Oct 2021 22:14:02 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1635189242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=paRwaeFNABP840HXNcIWIoCRnZfBBPACR2vgtnHAV40=; b=U2qHnqZ9pSeE7V1sDu5TWhTAv9hL/cyBomzUGWp6jDt++Tg0Ya6s5d+EF0wtU3+yr35uSx ElTpRgsrrqKKcNHe9acWqvLsKYZaXQ/54/rkfZuR3VZdbta6c6BpdmS9N9S9YzYyVCW3/f J/q0fMMMQ63KbufL/Mb5s6Q1qIPVpOsQsHLjuggqT7sX6ScxMluemvvKgOVSwftf0pzm6k KD5KBeQw3aboNiSTob2SJATeg0n7SUFhKfcHDMf5adVQrI7cH+AJ2GAK5zvvf1CQyhn10p ndWTYROJvCZp/zhUcEjKGijkv7A1JaW3KH+YBRywcFEM3yE0VagYestkSwlptA== From: Tomi Ollila To: David Bremner , notmuch@notmuchmail.org Subject: Re: [PATCH 2/2] test/new: replace use of gdb in vanishing file test In-Reply-To: <20211025011515.2533779-3-david@tethera.net> References: <20211025011515.2533779-1-david@tethera.net> <20211025011515.2533779-3-david@tethera.net> User-Agent: Notmuch/0.33+54~gcaf4513 (https://notmuchmail.org) Emacs/27.1 X-Face: HhBM'cA~ MIME-Version: 1.0 ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1635189242; a=rsa-sha256; cv=none; b=o3djA70XzjVBglODHPtBMs8F73yYoZosuQ/LPbpXgf6W/5DflmFc6w4vSMNK+jnq37Rr6L TFadDHu9BkqpMt+dMGVhVhE7T+5RYQ5BnMSQRWvf3kdqdm955otxe7YcdhHcna1OcgBphD veHunA5ojiBXiQO3Cc+FyaEL/0ob742/kU/9vLJNV9ER1Hwj/XO2kA9Nf9TPXOA7QBlKBs m8x/2GS9Mp70IgBp5zh1YEDULyAPaCKNFRdwUltEAyu4NgisGAo4oj2BTM0EEoaUVI88kF bED08M7U2DpOjiVtxMe3CgK8D4qNHvC+pGxpQou0TPT1CrX+ndikaDyhboqSRw== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=too smtp.mailfrom=tomi.ollila@iki.fi ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1635189242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=paRwaeFNABP840HXNcIWIoCRnZfBBPACR2vgtnHAV40=; b=tWUx30CZsAaIBR2RFVpCSxTzuYrk0/9yi/Cx9HSg+4sd8Jo/kkCQdDpHLbL74ul1ekLruh CblUqK2Z30ObZXS6DVBxaFlTtqdsVuUrS/1q3kCqBGbu4giYuMss0P8VWPfc1jawaidFzU 1AY9XjhgbmJU/tKBoGJppBl9+F2L48J9SJ1a7cVUjAZLRId51bxvrk4fwKcBlCiFJEN7WZ +kPJnHFHcWDOTDsFBZQujTpw0ZoK1LJaMidDcr0ViYSUTx4S/Zb2UXcykaylCPnt3VeJzO /CHiwBe1/1EQZcKU5znAlX/VEVNL5nl+DGMHIqn13Nbk1Q5pU5mTB9DpNEEWzA== Message-ID-Hash: JUNW7VRN3FSGLDOVLBYVN5HPO75B7ZFM X-Message-ID-Hash: JUNW7VRN3FSGLDOVLBYVN5HPO75B7ZFM X-MailFrom: tomi.ollila@iki.fi 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." List-Help: List-Owner: 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=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1635189252; 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:dkim-signature; bh=B3DTpADWmfv+W4xUkOWzdRd55dOtWLM15xyhNhow3FU=; b=DQF1xEVvCNbs42gpmTYmGeaH5RnVTAbjFNxkf8WhMRI6mhcU14P0MyIhRqR8WcKkxv41ZD UZol7/RD1mMNlQhr13ch7MHfDQ0r4pUnNlhXBRvqH8m4YizEbylxVjBG+AHn6Xikgdj6x4 PEbzKGQCidS47FavngzQDloewT7LuLNtWHZqMVoWDirBAr85IHyNvuCEzjd+YY9LzsK8ya ee6HMbt0jdEEZUmE1e3NX6ks6+3fPSWtM7AiilTiz3mVM9dt1sY5miAJnP+a+67TieS8gw aT63hTKNxSX+0QjchQbcGJa0jF1SOzAnGiBPWtUmYASf6RNavuAqBctFQtp8Nw== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1635189252; a=rsa-sha256; cv=fail; b=qaGtgXTKmN2oGXgjwQuV+KLNhR6XH/mgHcb9nm3FIYIAHyhq2DVluqJ1nfn+spEAyeQx74 BDl0HAgeOt3zm7FHwPZ/IGRGpJ0q447dd1Woa6m9tBEH8WeAR0GHuLPqJGAdmkKx1UznUS fiAt4QY3IGH0J7Sl0xmcoPeuApBiGCiBs+7uZ7yvXj1pIyx928wf2pfDqpjPdBVu1K7xHK HwJMmAQW1MgWYmFAliBLfpYOJZ1JR2BJ8C+QgCvFcHSm4WD7i7yeQ9iPmcmRb6I6Tm/E4T hCiv1zB1eHZZqFpuIoIPUBv6Y+riAvOrJlnOwRMXflgQC9prd2gubYUwDk3FIA== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=iki.fi header.s=lahtoruutu header.b=U2qHnqZ9; arc=reject ("signature check failed: fail, {[1] = sig:iki.fi:reject}"); 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: 0.84 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=iki.fi header.s=lahtoruutu header.b=U2qHnqZ9; arc=reject ("signature check failed: fail, {[1] = sig:iki.fi:reject}"); 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: 235B7178DA X-Spam-Score: 0.84 X-Migadu-Scanner: scn0.migadu.com X-TUID: iQLSwp9it70i On Sun, Oct 24 2021, David Bremner wrote: > Because the file to be removed has a predictable name, we can hard > code it in the generated shim. I am not sure about the message above -- the file name is as predictable as it was before -- and the shim code is created dynamically, with same amout of flexibility as it was w/ the gdb script Anyway I ignore if the same message appears in style-fixed email (see below)... Tomi > --- > test/T050-new.sh | 44 ++++++++++++++++++++++++-------------------- > test/notmuch-test.h | 1 + > 2 files changed, 25 insertions(+), 20 deletions(-) > > diff --git a/test/T050-new.sh b/test/T050-new.sh > index 1141c1e3..5a03998b 100755 > --- a/test/T050-new.sh > +++ b/test/T050-new.sh > @@ -368,31 +368,35 @@ chmod u+w ${MAIL_DIR}/.notmuch/xapian/*.* > test_expect_equal "$output" "A Xapian exception occurred opening database" > > > +make_shim dif-shim< +#include > +notmuch_status_t > +notmuch_database_index_file (notmuch_database_t *database, > + const char *filename, > + notmuch_indexopts_t *indexopts, > + notmuch_message_t **message) > +{ > + static notmuch_status_t (*orig_notmuch_database_index_file) > + (notmuch_database_t *database, > + const char *filename, > + notmuch_indexopts_t *indexopts, > + notmuch_message_t **message) = NULL; > + TEST_SAVE_ORIG(notmuch_database_index_file); > + > + if (unlink("${MAIL_DIR}/vanish")) { > + fprintf(stderr, "unlink failed\n"); > + exit(42); style not 'exit (42)' like in sources, and in previous change -- mostly in previous change, there was also at least one fn() use, which I failed to comment... anyway, asking for consistent style. > + } > + return orig_notmuch_database_index_file(database, filename, indexopts, message); > +} > +EOF > + > test_begin_subtest "Handle files vanishing between scandir and add_file" > > # A file for scandir to find. It won't get indexed, so can be empty. > touch ${MAIL_DIR}/vanish > - > -# Breakpoint to remove the file before indexing > -cat < notmuch-new-vanish.gdb > -set breakpoint pending on > -set logging file notmuch-new-vanish-gdb.log > -set logging on > -break notmuch_database_index_file > -commands > -shell rm -f ${MAIL_DIR}/vanish > -continue > -end > -run > -EOF > - > -${TEST_GDB} --batch-silent --return-child-result -x notmuch-new-vanish.gdb \ > - --args notmuch new 2>OUTPUT 1>/dev/null > +notmuch_with_shim dif-shim new 2>OUTPUT 1>/dev/null > echo "exit status: $?" >> OUTPUT > - > -# Clean up the file in case gdb isn't available. > -rm -f ${MAIL_DIR}/vanish > - > cat < EXPECTED > Unexpected error with file ${MAIL_DIR}/vanish > add_file: Something went wrong trying to read or write a file > diff --git a/test/notmuch-test.h b/test/notmuch-test.h > index 8613a299..94348d69 100644 > --- a/test/notmuch-test.h > +++ b/test/notmuch-test.h > @@ -7,6 +7,7 @@ > #include > #include > #include > +#include > > inline static void > expect0 (int line, notmuch_status_t ret) > -- > 2.33.0