Skip to content

Commit

Permalink
Fix test_blocking_lock_file for cygwin
Browse files Browse the repository at this point in the history
This permits the longer delay in test_blocking_lock_file--which was
already allowed for native Windows--on Cygwin, where it is also
needed. That lets the xfail mark for Cygwin be removed.

This also updates the comments to avoid implying that the need for
the delay is AppVeyor-specific (it seems needed on CI and locally).
  • Loading branch information
EliahKagan committed Sep 25, 2023
1 parent 9c7ff1e commit 0eb38bc
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions test/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from unittest import mock, skipIf
from datetime import datetime

import pytest
import ddt

from git.cmd import dashify
Expand Down Expand Up @@ -156,11 +155,6 @@ def test_lock_file(self):
lock_file._obtain_lock_or_raise()
lock_file._release_lock()

@pytest.mark.xfail(
sys.platform == "cygwin",
reason="Cygwin fails here for some reason, always",
raises=AssertionError,
)
def test_blocking_lock_file(self):
my_file = tempfile.mktemp()
lock_file = BlockingLockFile(my_file)
Expand All @@ -173,9 +167,8 @@ def test_blocking_lock_file(self):
self.assertRaises(IOError, wait_lock._obtain_lock)
elapsed = time.time() - start
extra_time = 0.02
if is_win:
# for Appveyor
extra_time *= 6 # NOTE: Indeterministic failures here...
if is_win or sys.platform == "cygwin":
extra_time *= 6 # NOTE: Indeterministic failures without this...
self.assertLess(elapsed, wait_time + extra_time)

def test_user_id(self):
Expand Down

0 comments on commit 0eb38bc

Please sign in to comment.