git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Santiago Torres <santiago@nyu.edu>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: What's cooking in git.git (Jul 2017, #04; Thu, 13)
Date: Tue, 18 Jul 2017 13:54:59 -0400	[thread overview]
Message-ID: <20170718175458.hadk64c3yccyv57t@LykOS.localdomain> (raw)
In-Reply-To: <xmqqmv82g1g7.fsf@gitster.mtv.corp.google.com>


[-- Attachment #1.1: Type: text/plain, Size: 1069 bytes --]

On Mon, Jul 17, 2017 at 03:09:44PM -0700, Junio C Hamano wrote:
> I am not sure if it is merely "if it's even necessary"; if there are
> two tests running in parallel, with their own separate
> $TRASH_DIRECTORY, and one of them say "kill the agent" at the
> beginning, would it affect the other test, depending on the timing?

This shouldn't happen, provided their respective GNUPGHOME env vars
aren't the same. A gpg-agent process is spawned per GNUPGHOME on the
versions that I've tested.

> 
> I would imagine that the sockets are kept per GNUPGHOME and they are
> not going to interfere, so if that is the case, I do not think we
> mind helping folks with a buggy versions of GnuPG by having a "let's
> be cautious and kill a leftover agent before starting to test"
> patch, as long as the reason why we do so is clearly understood and
> documented.

I double checked the patch/solutions/causes just to be sure I'm not
doing anything crazy. Here's a v2 of the patch that kills the agent upon
cleanup rather than startup.

Thanks!
-Santiago.

[-- Attachment #1.2: 0001-t-test-lib-flush-gpg-agent-on-cleanup.patch --]
[-- Type: text/x-diff, Size: 1248 bytes --]

From 20491890b804d13f9edb0205c1cc21d080beffe2 Mon Sep 17 00:00:00 2001
From: Santiago Torres <santiago@nyu.edu>
Date: Tue, 18 Jul 2017 13:16:11 -0400
Subject: [RFC/PATCH] t: test-lib: flush gpg agent on cleanup

When running gpg-relevant tests, a gpg-daemon is spawned for each
GNUPGHOME used. This daemon may stay running after the testand cache ile
descriptors for the trash directories, even after the trash directory is
removed. This leads to ENOENT errors when attempting to create files if
tests are run multiple times.

Add a cleanup script to force flushing the gpg-agent when before
removing the trash directory if the test is GPG-relevant.

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Santiago Torres <santiago@nyu.edu>
---
 t/test-lib.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/t/test-lib.sh b/t/test-lib.sh
index 1b6e53f78..ed8796d7a 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -732,6 +732,11 @@ test_done () {
 		EOF
 	fi
 
+	if test_have_prereq GPG
+	then
+		GNUPGHOME="$TRASH_DIRECTORY/gpghome" gpgconf --kill all
+	fi
+
 	if test "$test_fixed" != 0
 	then
 		say_color error "# $test_fixed known breakage(s) vanished; please update test(s)"
-- 
2.13.3


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2017-07-18 17:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-13 23:44 What's cooking in git.git (Jul 2017, #04; Thu, 13) Junio C Hamano
2017-07-14  0:27 ` Santiago Torres
2017-07-14  2:32   ` Junio C Hamano
2017-07-14 14:02     ` Santiago Torres
2017-07-14 15:25       ` Junio C Hamano
2017-07-17 21:42         ` Santiago Torres
2017-07-17 22:09           ` Junio C Hamano
2017-07-18 17:54             ` Santiago Torres [this message]
2017-07-18 18:46               ` Junio C Hamano
2017-07-18 21:16                 ` Santiago Torres
2017-07-18 21:38                   ` Junio C Hamano
2017-07-15 11:12 ` Ævar Arnfjörð Bjarmason
2017-07-17 17:55   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170718175458.hadk64c3yccyv57t@LykOS.localdomain \
    --to=santiago@nyu.edu \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).