Skip to content

Commit 29ff1f8

Browse files
SantiagoTorresgitster
authored andcommitted
t: lib-gpg: flush gpg agent on startup
When running gpg-relevant tests, a gpg-daemon is spawned for each GNUPGHOME used. This daemon may stay running after the test and cache file 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 for that GNUPGHOME (if any) before setting up the GPG relevant-environment. Helped-by: Junio C Hamano <[email protected]> Signed-off-by: Santiago Torres <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 08f9c32 commit 29ff1f8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

t/lib-gpg.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ then
3131
chmod 0700 ./gpghome &&
3232
GNUPGHOME="$(pwd)/gpghome" &&
3333
export GNUPGHOME &&
34+
(gpgconf --kill gpg-agent 2>&1 >/dev/null || : ) &&
3435
gpg --homedir "${GNUPGHOME}" 2>/dev/null --import \
3536
"$TEST_DIRECTORY"/lib-gpg/keyring.gpg &&
3637
gpg --homedir "${GNUPGHOME}" 2>/dev/null --import-ownertrust \

0 commit comments

Comments
 (0)