Skip to content

Windows tests fail #655

Closed
Closed

Description

@techtonik

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'

Activity

  1. techtonik commented on Oct 8, 2016

    @techtonik
    ContributorAuthor

    First guess is that index = Index() resource needs to be freed.

  2. jdavid commented on Oct 9, 2016

    @jdavid
    Member
  3. fourplusone commented on Oct 9, 2016

    @fourplusone
    Contributor

    Indeed, however lots tests are still failing :( It seems mostly related to files not being closed at the end of the test

  4. techtonik commented on Oct 9, 2016

    @techtonik
    ContributorAuthor

    Even partial fix is good. I can help only one by one.

  5. jdavid commented on Oct 13, 2016

    @jdavid
    Member

    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?

  6. fourplusone commented on Oct 13, 2016

    @fourplusone
    Contributor

    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... statement

  7. jdavid commented on Oct 14, 2016

    @jdavid
    Member

    Thanks @fourplusone , it's red now. Do you know how to trigger a build automatically on every push to master?

  8. fourplusone commented on Oct 14, 2016

    @fourplusone
    Contributor

    This should be done automatically

    From https://www.appveyor.com/docs/:

    For every project AppVeyor will configure webhooks for its repository to automatically start a build when you push the changes. For every private project AppVeyor will add an SSH public key (deployment key) to the clone repository on the build machine.

  9. techtonik commented on Oct 15, 2016

    @techtonik
    ContributorAuthor

    It makes sense to enable AppVeyor test for pull requests too http://help.appveyor.com/discussions/questions/203-auto-run-tests-on-pull-requests

  10. jdavid commented on Oct 18, 2016

    @jdavid
    Member

    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.

  11. techtonik commented on Oct 18, 2016

    @techtonik
    ContributorAuthor
  12. carlosmn commented on Oct 18, 2016

    @carlosmn
    Member

    @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.

  13. jdavid commented on Oct 18, 2016

    @jdavid
    Member

    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?

  14. carlosmn commented on Oct 18, 2016

    @carlosmn
    Member

    It looks like it used to be a stats tracking thing, but Twitter bought and shut it down, so let's just remove it.

  15. jdavid commented on Oct 18, 2016

    @jdavid
    Member

    thanks, removed

  16. techtonik commented on Oct 21, 2016

    @techtonik
    ContributorAuthor

    Fixed by #661. Thanks @fourplusone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions