From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 149CF6DE1493 for ; Mon, 20 May 2019 18:03:12 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.172 X-Spam-Level: X-Spam-Status: No, score=-0.172 tagged_above=-999 required=5 tests=[AWL=0.029, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id u5vGNzxiX7Oo for ; Mon, 20 May 2019 18:03:11 -0700 (PDT) Received: from che.mayfirst.org (che.mayfirst.org [162.247.75.118]) by arlo.cworth.org (Postfix) with ESMTPS id 566226DE1490 for ; Mon, 20 May 2019 18:03:11 -0700 (PDT) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019; t=1558400590; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=K3qN1izDiAigJ+RpkzSX6jvLr5NPAtBXvd01c41AmTM=; b=d1nJq7JrRwZtufuiNTGf62Qi5t1EI71F8S/mtVmyie5j0dfUH2h93oUX 5Ox2upYWf+L0tnDxAY1J3rNz+DOGBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019rsa; t=1558400590; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=K3qN1izDiAigJ+RpkzSX6jvLr5NPAtBXvd01c41AmTM=; b=i6b088MsxQEe/7OtSziO9EW1BzkW7NLCAtgoNtxWT4UOiVNOSNB7iqAS qTJAlCSb+THHbZV4lQLfTQfVtr60hAPYObXapr3PBvAp4fyEMSH+0tlfdV aKRSgFCCFtvq1BYyBSbJynGBszacASjpwbCjaFOzCiwXlpeR9j4ysDYY13 36V2ArJAqoaKGOalXKYFQMyIYx0424sqZUhqJwLY0m/cIRWxoD9j7QCdoc LxT5YmbDouAPRLarIsU3or3J18PRazpjMCYb0CCmDUGeLbgksbsOcZBqrm AyVqRtzGdQioyYIkVRtGs20aCf0monueQpEp3KcDMoht7kw3050j/w== Received: from fifthhorseman.net (unknown [38.109.115.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by che.mayfirst.org (Postfix) with ESMTPSA id 8DC1DF99D for ; Mon, 20 May 2019 21:03:10 -0400 (EDT) Received: by fifthhorseman.net (Postfix, from userid 1000) id 3D21E201C0; Mon, 20 May 2019 21:03:04 -0400 (EDT) From: Daniel Kahn Gillmor To: Notmuch Mail Subject: [PATCH] test: avoid hanging older gdb under GNU timeout and moreutils parallel Date: Mon, 20 May 2019 21:03:04 -0400 Message-Id: <20190521010304.417-1-dkg@fifthhorseman.net> X-Mailer: git-send-email 2.20.1 In-Reply-To: <87mujgab6j.fsf@fifthhorseman.net> References: <87mujgab6j.fsf@fifthhorseman.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 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: Tue, 21 May 2019 01:03:12 -0000 This is an empirical fix for a strange interaction we're seeing between gdb 7.12-6 on debian stretch, GNU timeout, and parallel from moreutils, reported by Bremner in id:87ef56io5d.fsf@tethera.net. The problem manifested itself as several concurrent test suite subprocesses getting stopped by SIGTTOU (including some that don't use gdb!), which ultimately caused a timeout for the test suite. This problem itself does not appear to afflict the test suite when using more modern version of gdb (e.g. 8.2.1-2 in debian buster), and this fix doesn't cause any problems on newer versions of gdb either, so it should be safe. This fix was inspired by a comment from amdragon introduced back in 9ade8160a6a3f6f55996d7a58dc2cd81a6df8395 (now in tests/T380-atomicity.sh) about an interaction between timeout and gdb. A marginally cleaner patch be to consistently use gdb with either one of: * -tty /dev/null * < /dev/null in all of T050, T060, and T070. But T070 can't use "< /dev/null" because it needs stdin. And when i tried to use "-tty /dev/null" in T050 and T060, i got test suite failures that i wasn't able to understand. So, here is a patch that fixes the hanging problems on the older setup without understanding them exactly. I welcome any improvements or actual understanding. Signed-off-by: Daniel Kahn Gillmor --- test/T050-new.sh | 2 +- test/T060-count.sh | 2 +- test/T070-insert.sh | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/test/T050-new.sh b/test/T050-new.sh index dfc8508f..9b3d41df 100755 --- a/test/T050-new.sh +++ b/test/T050-new.sh @@ -366,7 +366,7 @@ run EOF ${TEST_GDB} --batch-silent --return-child-result -x notmuch-new-vanish.gdb \ - --args notmuch new 2>OUTPUT 1>/dev/null + --args notmuch new 2>OUTPUT 1>/dev/null > OUTPUT # Clean up the file in case gdb isn't available. diff --git a/test/T060-count.sh b/test/T060-count.sh index 0c0bf473..a393edb6 100755 --- a/test/T060-count.sh +++ b/test/T060-count.sh @@ -116,7 +116,7 @@ EOF backup_database test_begin_subtest "error message from query_search_messages" ${TEST_GDB} --batch-silent --return-child-result -x count-files.gdb \ - --args notmuch count --output=files '*' 2>OUTPUT 1>/dev/null + --args notmuch count --output=files '*' 2>OUTPUT 1>/dev/null < /dev/null cat < EXPECTED notmuch count: A Xapian exception occurred A Xapian exception occurred performing query diff --git a/test/T070-insert.sh b/test/T070-insert.sh index 05be473a..e30f0a43 100755 --- a/test/T070-insert.sh +++ b/test/T070-insert.sh @@ -267,12 +267,14 @@ for code in FILE_NOT_EMAIL READ_ONLY_DATABASE UPGRADE_REQUIRED PATH_ERROR; do test_begin_subtest "EXIT_FAILURE when index_file returns $code" test_expect_code 1 \ "${TEST_GDB} --batch-silent --return-child-result \ + -tty /dev/null \ -ex 'set args insert < $gen_msg_filename' \ -x index-file-$code.gdb notmuch" test_begin_subtest "success exit with --keep when index_file returns $code" test_expect_code 0 \ "${TEST_GDB} --batch-silent --return-child-result \ + -tty /dev/null \ -ex 'set args insert --keep < $gen_msg_filename' \ -x index-file-$code.gdb notmuch" done @@ -281,12 +283,14 @@ for code in OUT_OF_MEMORY XAPIAN_EXCEPTION ; do test_begin_subtest "EX_TEMPFAIL when index_file returns $code" test_expect_code 75 \ "${TEST_GDB} --batch-silent --return-child-result \ + -tty /dev/null \ -ex 'set args insert < $gen_msg_filename' \ -x index-file-$code.gdb notmuch" test_begin_subtest "success exit with --keep when index_file returns $code" test_expect_code 0 \ "${TEST_GDB} --batch-silent --return-child-result \ + -tty /dev/null \ -ex 'set args insert --keep < $gen_msg_filename' \ -x index-file-$code.gdb notmuch" done -- 2.20.1