Repository navigation
Windows tests fail #655
Copy link
Copy link
Closed
Description
https://ci.appveyor.com/project/jdavid/pygit2/branch/master/job/pe30m4i7qwl2br64
Windows has a strict requirements that all files need to be closed when removing dir. https://superuser.com/questions/2937/how-do-i-delete-a-folder-thats-in-use
======================================================================
ERROR: test_write_commit (test.test_archive.ArchiveTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Python35\lib\shutil.py", line 381, in _rmtree_unsafe
os.unlink(fullname)
PermissionError: [WinError 5] Access is denied: 'C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\tmp0up7s6rm\\testrepo\\.git\\objects\\pack\\pack-e6fbc15b315a0eab6005c44e5b7054b1f0043f39.idx'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\projects\pygit2\test\utils.py", line 135, in tearDown
self.repo_ctxtmgr.__exit__(None, None, None)
File "C:\projects\pygit2\test\utils.py", line 86, in __exit__
rmtree(self.temp_dir)
File "C:\projects\pygit2\test\utils.py", line 65, in rmtree
shutil.rmtree(path, onerror=onerror)
File "C:\Python35\lib\shutil.py", line 488, in rmtree
return _rmtree_unsafe(path, onerror)
File "C:\Python35\lib\shutil.py", line 378, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Python35\lib\shutil.py", line 378, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Python35\lib\shutil.py", line 378, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Python35\lib\shutil.py", line 378, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Python35\lib\shutil.py", line 383, in _rmtree_unsafe
onerror(os.unlink, fullname, sys.exc_info())
File "C:\projects\pygit2\test\utils.py", line 64, in <lambda>
onerror = lambda func, path, e: force_rm_handle(func, path, e)
File "C:\projects\pygit2\test\utils.py", line 47, in force_rm_handle
remove_path(path)
PermissionError: [WinError 5] Access is denied: 'C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\tmp0up7s6rm\\testrepo\\.git\\objects\\pack\\pack-e6fbc15b315a0eab6005c44e5b7054b1f0043f39.idx'
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
techtonik commentedon Oct 8, 2016
First guess is that
index = Index()resource needs to be freed.jdavid commentedon Oct 9, 2016
It looks like @fourplusone has already worked on this, see:
fourplusone commentedon Oct 9, 2016
Indeed, however lots tests are still failing :( It seems mostly related to files not being closed at the end of the test
techtonik commentedon Oct 9, 2016
Even partial fix is good. I can help only one by one.
jdavid commentedon Oct 13, 2016
I have merged branch fourplusone/fix/windows-tests from @fourplusone and errors are down to 7 from 146
But the build is green, it should be red since there are still 7 errors, @fourplusone do you know why it is green now?
fourplusone commentedon Oct 13, 2016
try { & $env:PYTHON setup.py nosetests --with-xunit } catch {}in appveyor.yaml catches all errors during the test. maybe one should remove the try...catch... statementjdavid commentedon Oct 14, 2016
Thanks @fourplusone , it's red now. Do you know how to trigger a build automatically on every push to master?
fourplusone commentedon Oct 14, 2016
This should be done automatically
From https://www.appveyor.com/docs/:
techtonik commentedon Oct 15, 2016
It makes sense to enable AppVeyor test for pull requests too http://help.appveyor.com/discussions/questions/203-auto-run-tests-on-pull-requests
jdavid commentedon Oct 18, 2016
http://help.appveyor.com/discussions/questions/203-auto-run-tests-on-pull-requests#comment_33212404
This requires access to the pygit2's settings page at github, which I don't have. So this will have to be handled by someone else, @carlosmn can you do this? Or may be give me the rights to manage pygit2's settings.
techtonik commentedon Oct 18, 2016
Only 7 tests left - https://ci.appveyor.com/project/techtonik/pygit2/build/1.0.12/tests
carlosmn commentedon Oct 18, 2016
@jdavid I've given you admin access to pygit2 so you should be able to set it all up yourself. Let me know if you run into problems.
jdavid commentedon Oct 18, 2016
Webhook added.
By the way there was already a broken webhook to tenxer.com, @carlosmn do you know what is it? Can I safely remove it?
carlosmn commentedon Oct 18, 2016
It looks like it used to be a stats tracking thing, but Twitter bought and shut it down, so let's just remove it.
jdavid commentedon Oct 18, 2016
thanks, removed
techtonik commentedon Oct 21, 2016
Fixed by #661. Thanks @fourplusone.