========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================= test session starts ==========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
platform linux -- Python 3.10.12, pytest-9.0.3, pluggy-1.6.0 -- /usr/bin/python3
cachedir: .pytest_cache
metadata: {'Python': '3.10.12', 'Platform': 'Linux-6.8.0-1026-gke-x86_64-with-glibc2.35', 'Packages': {'pytest': '9.0.3', 'pluggy': '1.6.0'}, 'Plugins': {'metadata': '3.1.1', 'anyio': '4.13.0', 'cov': '7.1.0', 'json-report': '1.5.0'}}
rootdir: /workspace/portalocker
configfile: pytest.ini
plugins: metadata-3.1.1, anyio-4.13.0, cov-7.1.0, json-report-1.5.0
collected 40 items / 2 skipped

portalocker_tests/temporary_file_lock.py::test_temporary_file_lock PASSED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        [  2%]
portalocker_tests/test_combined.py::test_combined PASSED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         [  5%]
portalocker_tests/test_semaphore.py::test_bounded_semaphore[None-None] FAILED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    [  7%]
portalocker_tests/test_semaphore.py::test_bounded_semaphore[None-0] FAILED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       [ 10%]
portalocker_tests/test_semaphore.py::test_bounded_semaphore[None-0.001] FAILED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   [ 12%]
portalocker_tests/test_semaphore.py::test_bounded_semaphore[0-None] FAILED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       [ 15%]
portalocker_tests/test_semaphore.py::test_bounded_semaphore[0-0] FAILED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          [ 17%]
portalocker_tests/test_semaphore.py::test_bounded_semaphore[0-0.001] FAILED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      [ 20%]
portalocker_tests/test_semaphore.py::test_bounded_semaphore[0.0005-None] FAILED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  [ 22%]
portalocker_tests/test_semaphore.py::test_bounded_semaphore[0.0005-0] FAILED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     [ 25%]
portalocker_tests/test_semaphore.py::test_bounded_semaphore[0.0005-0.001] FAILED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 [ 27%]
portalocker_tests/tests.py::test_exceptions PASSED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               [ 30%]
portalocker_tests/tests.py::test_utils_base PASSED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               [ 32%]
portalocker_tests/tests.py::test_with_timeout PASSED                                                                                                                                                                                                                                                                                                                                                                                                            <response clipped><NOTE>Due to the max output limit, only part of the full response has been shown to you.</NOTE> _ _ _ _ _ _ _ _ _ _ _

self = <portalocker.utils.Lock object at 0x7436ecd46ad0>, fh = <_io.TextIOWrapper name='/tmp/0.874055310702253.01.lock' mode='a' encoding='UTF-8'>, timeout = 0, check_interval = 0.25, fail_when_locked = True

    def _get_lock(self, fh: typing.IO, timeout: typing.Optional[float], check_interval: typing.Optional[float], fail_when_locked: bool) -> typing.IO:
        """
        Try to lock the given filehandle

        returns LockException if it fails"""
        start_time = time.time()
        while True:
            if timeout is not None and time.time() - start_time >= timeout:
>               raise exceptions.LockException(fh=fh)
E               portalocker.exceptions.LockException

portalocker/utils.py:194: LockException
___________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ test_bounded_semaphore[0.0005-0] ___________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

timeout = 0, check_interval = 0.0005, monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7436ece25990>

    @pytest.mark.parametrize('timeout', [None, 0, 0.001])
    @pytest.mark.parametrize('check_interval', [None, 0, 0.0005])
    def test_bounded_semaphore(timeout, check_interval, monkeypatch):
        n = 2
        name: str = str(random.random())
        monkeypatch.setattr(utils, 'DEFAULT_TIMEOUT', 0.0001)
        monkeypatch.setattr(utils, 'DEFAULT_CHECK_INTERVAL', 0.0005)

        semaphore_a = portalocker.BoundedSemaphore(n, name=name, timeout=timeout)
        semaphore_b = portalocker.BoundedSemaphore(n, name=name, timeout=timeout)
        semaphore_c = portalocker.BoundedSemaphore(n, name=name, timeout=timeout)

>       semaphore_a.acquire(timeout=timeout)

portalocker_tests/test_semaphore.py:21:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _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 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <portalocker.utils.Lock object at 0x7436ece25ae0>, fh = <_io.TextIOWrapper name='/tmp/0.5066864129994364.00.lock' mode='a' encoding='UTF-8'>, timeout = 0, check_interval = 0.25, fail_when_locked = True

    def _get_lock(self, fh: typing.IO, timeout: typing.Optional[float], check_interval: typing.Optional[float], fail_when_locked: bool) -> typing.IO:
        """
        Try to lock the given filehandle

        returns LockException if it fails"""
        start_time = time.time()
        while True:
            if timeout is not None and time.time() - start_time >= timeout:
>               raise exceptions.LockException(fh=fh)
E               portalocker.exceptions.LockException

portalocker/utils.py:194: LockException
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ test_bounded_semaphore[0.0005-0.001] _________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

timeout = 0.001, check_interval = 0.0005, monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7436ecda65f0>

    @pytest.mark.parametrize('timeout', [None, 0, 0.001])
    @pytest.mark.parametrize('check_interval', [None, 0, 0.0005])
    def test_bounded_semaphore(timeout, check_interval, monkeypatch):
        n = 2
        name: str = str(random.random())
        monkeypatch.setattr(utils, 'DEFAULT_TIMEOUT', 0.0001)
        monkeypatch.setattr(utils, 'DEFAULT_CHECK_INTERVAL', 0.0005)

        semaphore_a = portalocker.BoundedSemaphore(n, name=name, timeout=timeout)
        semaphore_b = portalocker.BoundedSemaphore(n, name=name, timeout=timeout)
        semaphore_c = portalocker.BoundedSemaphore(n, name=name, timeout=timeout)

>       semaphore_a.acquire(timeout=timeout)

portalocker_tests/test_semaphore.py:21:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _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 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <portalocker.utils.Lock object at 0x7436ecda6f20>, fh = <_io.TextIOWrapper name='/tmp/0.9988205171988348.01.lock' mode='a' encoding='UTF-8'>, timeout = 0, check_interval = 0.25, fail_when_locked = True

    def _get_lock(self, fh: typing.IO, timeout: typing.Optional[float], check_interval: typing.Optional[float], fail_when_locked: bool) -> typing.IO:
        """
        Try to lock the given filehandle

        returns LockException if it fails"""
        start_time = time.time()
        while True:
            if timeout is not None and time.time() - start_time >= timeout:
>               raise exceptions.LockException(fh=fh)
E               portalocker.exceptions.LockException

portalocker/utils.py:194: LockException
=========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================== warnings summary ===========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
../../home/openhands/.local/lib/python3.10/site-packages/_pytest/config/__init__.py:1434
  /home/openhands/.local/lib/python3.10/site-packages/_pytest/config/__init__.py:1434: PytestConfigWarning: Unknown config option: timeout

    self._warn_or_fail_if_strict(f"Unknown config option: {key}\n")

portalocker_tests/tests.py::test_locker_mechanism[flock]
portalocker_tests/tests.py::test_locker_mechanism[lockf]
  /workspace/portalocker/portalocker/utils.py:160: UserWarning: timeout has no effect in blocking mode
    warnings.warn('timeout has no effect in blocking mode', stacklevel=1)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
======================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================= short test summary info ========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
FAILED portalocker_tests/test_semaphore.py::test_bounded_semaphore[None-None] - portalocker.exceptions.LockException
FAILED portalocker_tests/test_semaphore.py::test_bounded_semaphore[None-0] - portalocker.exceptions.LockException
FAILED portalocker_tests/test_semaphore.py::test_bounded_semaphore[None-0.001] - portalocker.exceptions.LockException
FAILED portalocker_tests/test_semaphore.py::test_bounded_semaphore[0-None] - portalocker.exceptions.LockException
FAILED portalocker_tests/test_semaphore.py::test_bounded_semaphore[0-0] - portalocker.exceptions.LockException
FAILED portalocker_tests/test_semaphore.py::test_bounded_semaphore[0-0.001] - portalocker.exceptions.LockException
FAILED portalocker_tests/test_semaphore.py::test_bounded_semaphore[0.0005-None] - portalocker.exceptions.LockException
FAILED portalocker_tests/test_semaphore.py::test_bounded_semaphore[0.0005-0] - portalocker.exceptions.LockException
FAILED portalocker_tests/test_semaphore.py::test_bounded_semaphore[0.0005-0.001] - portalocker.exceptions.LockException
========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================= 9 failed, 31 passed, 2 skipped, 3 warnings in 13.30s =========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
[The command completed with exit code 1.]
[Current working directory: /workspace/portalocker]
[Python interpreter: /usr/bin/python]
[Command finished with exit code 1]