Edgewall Software

Opened 8 years ago

Last modified 8 years ago

#12304 closed defect

tracopt.versioncontrol.git.tests failures on Windows — at Initial Version

Reported by: Christian Boos Owned by: Christian Boos
Priority: normal Milestone: 1.0.10
Component: general Version: 1.0dev
Severity: minor Keywords: git windows appveyor
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

On AppVeyor, I got a bunch of Git related failures, all looking like these two:

======================================================================
ERROR: test_git_version (tracopt.versioncontrol.git.tests.PyGIT.GitTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\projects\trac\tracopt\versioncontrol\git\tests\PyGIT.py", line 46, in test_git_version
    v = Storage.git_version()
  File "C:\projects\trac\tracopt\versioncontrol\git\PyGIT.py", line 339, in git_version
    % (git_bin, repr(e)))
GitError: Could not retrieve GIT version (tried to execute/parse 'git --version' but got WindowsError(6, 'The handle is invalid'))

======================================================================
ERROR: test_control_files_detection (tracopt.versioncontrol.git.tests.PyGIT.NormalTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\projects\trac\tracopt\versioncontrol\git\tests\PyGIT.py", line 163, in setUp
    self._git('init')

  File "C:\projects\trac\tracopt\versioncontrol\git\tests\git_fs.py", line 61, in _git
    proc = self._spawn_git(*args, **kwargs)
  File "C:\projects\trac\tracopt\versioncontrol\git\tests\git_fs.py", line 58, in _spawn_git
    return Popen(args, close_fds=close_fds, **kwargs)
  File "C:\Miniconda\lib\subprocess.py", line 702, in __init__
    errread, errwrite), to_close = self._get_handles(stdin, stdout, stderr)
  File "C:\Miniconda\lib\subprocess.py", line 823, in _get_handles
    p2cread = _subprocess.GetStdHandle(_subprocess.STD_INPUT_HANDLE)
WindowsError: [Error 6] The handle is invalid

Thanks to #10552, I could see that they're probably due to the fact that in this test environment, the process doesn't have access to a proper console as its standard input.

So far I have not found a way to reproduce the issue on my system. If I close stdin (( exec 0<&- ; make test=tracopt/versioncontrol/git/tests/PyGIT.py )) the tests pass.

Based on the suggestions found in #10552, I'll commit a tentative fix to see if it works on that system.

Change History (0)

Note: See TracTickets for help on using tickets.