Kill gpg agent in package-test.el to avoid a race
authorRob Browning <rlb@defaultvalue.org>
Mon, 10 Oct 2016 22:35:56 +0000 (17:35 -0500)
committerSean Whitton <spwhitton@spwhitton.name>
Mon, 24 Feb 2025 07:32:17 +0000 (15:32 +0800)
commit2968c8004590ff6e233f6e3b102b99cee2ec6936
treeaafbc1636314f8412f16db607c35c69cc603ac6b
parenta67a63533c85ea632331b85b65df8cf6ce574aa0
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.
test/lisp/emacs-lisp/package-tests.el