From: Rob Browning Date: Mon, 10 Oct 2016 22:35:56 +0000 (-0500) Subject: Kill gpg agent in package-test.el to avoid a race X-Git-Tag: archive/raspbian/1%29.4+1-4+rpi1~1^2~17^2~9 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a309766b2c430303542d35bc840c96af04690dbe;p=emacs.git Kill gpg agent in package-test.el to avoid a race package-test.el should no longer fail during clean up. * Previously a delete-directories call raced with the gpg agent's own cleanup process (presumably triggered by the first deletion of one of the agent's sockets). As a result, it looks like the agent might delete one of its sockets after delete-directories had decided to delete the socket, but before it made the attempt, causing an exception. * To fix the problem, explicitly ask gpg-connect-agent to kill the agent before attempting to delete the gnupg home directory, and then delete via "rm -rf" to ignore any vanishing files. --- diff --git a/test/lisp/emacs-lisp/package-tests.el b/test/lisp/emacs-lisp/package-tests.el index 5176c6abcd8..ee481822705 100644 --- a/test/lisp/emacs-lisp/package-tests.el +++ b/test/lisp/emacs-lisp/package-tests.el @@ -160,6 +160,14 @@ (delete-file (expand-file-name f package-test-archive-upload-base)))) (delete-directory package-test-archive-upload-base)) + (call-process "gpg-connect-agent" nil nil nil + "--homedir" (concat package-test-user-dir "/gnupg") + "--no-autostart" + "killagent" "/bye") + ;; Call "rm -rf" instead of delete-directory so that it won't + ;; choke if the gpg-agent sockets disappear during the + ;; recursive traversal. + (call-process "rm" nil nil nil "-r" package-test-user-dir) (when (and (boundp 'package-test-archive-upload-base) (file-directory-p package-test-archive-upload-base))