hpk42 / muacrypt

Autocrypt and more for Mail User Agents
Other
36 stars 15 forks source link

Tests fail deleting temporal gnupg home directory because of race condition deleting gpg-agent socket #3

Closed juga0 closed 7 years ago

juga0 commented 7 years ago

Extract of the error: .tox/py27/local/lib/python2.7/site-packages/autocrypt/account.py:237: in del_identity ident.delete() .tox/py27/local/lib/python2.7/site-packages/autocrypt/account.py:382: in delete shutil.rmtree(self.dir) /usr/lib/python2.7/shutil.py:247: in rmtree rmtree(fullname, ignore_errors, onerror) /usr/lib/python2.7/shutil.py:252: in rmtree onerror(os.remove, fullname, sys.exc_info()) [...]

              os.remove(fullname)

E OSError: [Errno 2] No such file or directory: '/tmp/pytest-of-user/pytest-4/test6/a0/id/office/gpghome/S.gpg-agent.browser'

/usr/lib/python2.7/shutil.py:250: OSError

This might be caused because the socket is deleted before rmtree deletes the directory. The solution for this could be to replace the line: shutil.rmtree(self.dir) with: shutil.rmtree(self.dir, ignore_errors=True)