Installing simple package with Chocolately times out

tl;dr Trying to install the GnuPG package on windows-latest with choco install GnuPG times out.

I would expect this GitHub Workflow:

name: main
on:
  pull_request:
  push:
jobs:
  test:
    runs-on: windows-latest
    steps:
    - name: Install GnuPG
      run: |
        choco install --verbose GnuPG
    - name: Check GnuPG installation
      run: gpg --version

To install the GnuPG package on windows-latest using Chocolately, but it stalls after a few minutes and eventually times out. The last few lines of the run log are:

VERBOSE: Importing alias 'Invoke-ChocolateyProcess'.
VERBOSE: Importing alias 'refreshenv'.
VERBOSE: Importing alias 'Remove-BinFile'.
VERBOSE: Importing alias 'Start-ChocolateyProcess'.
Installing gnupg...

And then nothing more.

You can see an example run and the twpayne/github-actions-chocolatey-test GitHub repo contains a minimal workflow that reproduces this problem.

I need gpg version 2 (not version 1) installed for an integration test on Windows.

Am I doing something wrong? For info, I get the same timeout problem with the Gpg4win and openssl Chocolately packages, so it doesn’t seem to be package specific.

Actually, after 45 minutes (!) you get the error message from Chocolately:

Chocolatey timed out waiting for the command to finish. The timeout 
 specified (or the default value) was '2700' seconds. Perhaps try a 
 higher `--execution-timeout`? See `choco -h` for details.
  gnupg may be able to be automatically uninstalled.
The install of gnupg was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\gnupg\tools\chocolateyInstall.ps1'.
 See log for details.
This is try 1/3. Retrying after 300 milliseconds.
 Error converted to warning:
 (5) Access is denied: [\\?\C:\ProgramData\chocolatey\lib-bad\gnupg]
This is try 2/3. Retrying after 400 milliseconds.
 Error converted to warning:
 (5) Access is denied: [\\?\C:\ProgramData\chocolatey\lib-bad\gnupg]
Maximum tries of 3 reached. Throwing error.
Move failed with message:
 (5) Access is denied: [\\?\C:\ProgramData\chocolatey\lib-bad\gnupg]
 Attempting backup move method.
This is try 1/3. Retrying after 300 milliseconds.
 Error converted to warning:
 (32) The process cannot access the file because it is being used by another process: [\\?\C:\ProgramData\chocolatey\lib-bad\gnupg\tools\gnupg-w32-2.2.27_20210111.exe]
This is try 2/3. Retrying after 400 milliseconds.
 Error converted to warning:
 (32) The process cannot access the file because it is being used by another process: [\\?\C:\ProgramData\chocolatey\lib-bad\gnupg\tools\gnupg-w32-2.2.27_20210111.exe]
Maximum tries of 3 reached. Throwing error.
Could not move bad package to failure directory It will show as installed.
 C:\ProgramData\chocolatey\lib\gnupg
 The error:
 (32) The process cannot access the file because it is being used by another process: [\\?\C:\ProgramData\chocolatey\lib-bad\gnupg\tools\gnupg-w32-2.2.27_20210111.exe]

Chocolatey installed 0/1 packages. 1 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures
 - gnupg (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\gnupg\tools\chocolateyInstall.ps1'.
 See log for details.

Enjoy using Chocolatey? Explore more amazing features to take your
experience to the next level at
 https://chocolatey.org/compare