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, which needs it too.
That makes the Cygwin xfail no longer needed, so this removes that.

It 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 15, 2023
1 parent 06883fa commit 0aca35f
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 0aca35f

Please sign in to comment.