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>
Sun, 30 Jul 2023 18:55:08 +0000 (19:55 +0100)
commitdd14c8a6a1844d7d55ec204190387aa8856de5ff
treea91bfaa79660ccbe5a5135fb40e47ae9c22d845e
parent3e290ebbf7f48d31159141dc3ff17f2ca9bff53c
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