Edgewall Software

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#12304 closed defect (fixed)

tracopt.versioncontrol.git.tests failures on Windows

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:

Fixed test failure from tracopt.versioncontrol.git on Windows.

API Changes:
Internal Changes:


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

  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.

Attachments (0)

Change History (6)

comment:1 by Jun Omae, 5 years ago

#12292 is the same issue?

in reply to:  1 comment:2 by Christian Boos, 5 years ago

Replying to jomae:

#12292 is the same issue?

Looks very similar yes, this time with stderr. The line return self.__pipe('cat-file', '--batch', stdin=PIPE, stdout=PIPE) indeed leaves stderr unspecified, i.e. it will be the "real" stderr, which might be invalid for some reason.

The tentative fix [14418] worked but was not complete, as it missed two tests involving __pipe.

comment:3 by Christian Boos, 5 years ago

With [14419] all git related issues are gone, on AppVeyor build 1.0-stable.31.

comment:4 by Christian Boos, 5 years ago

Resolution: fixed
Status: assignedclosed

Merged on trunk in [14425].

However, see also #12309 for a similar error in another context.

comment:5 by Christian Boos, 5 years ago

Keywords: appveyor added

comment:6 by Ryan J Ollos, 5 years ago

Release Notes: modified (diff)

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment

E-mail address and name can be saved in the Preferences .
Note: See TracTickets for help on using tickets.