========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================= 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 FAILED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        [  2%]
portalocker_tests/test_combined.py::test_combined PASSED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         [  5%]
portalocker_tests/test_semaphore.py::test_bounded_semaphore[None-None] PASSED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    [  7%]
portalocker_tests/test_semaphore.py::test_bounded_semaphore[None-0] PASSED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       [ 10%]
portalocker_tests/test_semaphore.py::test_bounded_semaphore[None-0.001] PASSED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   [ 12%]
portalocker_tests/test_semaphore.py::test_bounded_semaphore[0-None] PASSED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       [ 15%]
portalocker_tests/test_semaphore.py::test_bounded_semaphore[0-0] PASSED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          [ 17%]
portalocker_tests/test_semaphore.py::test_bounded_semaphore[0-0.001] PASSED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      [ 20%]
portalocker_tests/test_semaphore.py::test_bounded_semaphore[0.0005-None] PASSED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  [ 22%]
portalocker_tests/test_semaphore.py::test_bounded_semaphore[0.0005-0] PASSED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     [ 25%]
portalocker_tests/test_semaphore.py::test_bounded_semaphore[0.0005-0.001] PASSED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 [ 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>                                                                                                                                                                                                                        [ 90%]
portalocker_tests/tests.py::test_lock_fileno[lockf] PASSED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       [ 92%]
portalocker_tests/tests.py::test_locker_mechanism[flock] PASSED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  [ 95%]
portalocker_tests/tests.py::test_locker_mechanism[lockf] PASSED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  [ 97%]
portalocker_tests/tests.py::test_exception PASSED                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [100%]

=============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================== FAILURES ===============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
_______________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ test_temporary_file_lock _______________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

tmpfile = '/tmp/pytest-of-openhands/pytest-6/test_temporary_file_lock0/6895842988994113'

    def test_temporary_file_lock(tmpfile):
        with portalocker.TemporaryFileLock(tmpfile):
            pass

>       assert not os.path.isfile(tmpfile)
E       AssertionError: assert not True
E        +  where True = <function isfile at 0x7eaee2bb5f30>('/tmp/pytest-of-openhands/pytest-6/test_temporary_file_lock0/6895842988994113')
E        +    where <function isfile at 0x7eaee2bb5f30> = <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'>.isfile
E        +      where <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'> = os.path

portalocker_tests/temporary_file_lock.py:10: AssertionError
________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ test_exclusive_processes[lockf-False] _________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

tmpfile = '/tmp/pytest-of-openhands/pytest-6/test_exclusive_processes_lockf1/4133544850288715', fail_when_locked = False, locker = <built-in function lockf>

    @pytest.mark.parametrize('fail_when_locked', [True, False])
    @pytest.mark.parametrize('locker', LOCKERS, indirect=True)
    def test_exclusive_processes(tmpfile: str, fail_when_locked: bool, locker):
        flags = LockFlags.EXCLUSIVE | LockFlags.NON_BLOCKING

        print('Locking', tmpfile, fail_when_locked, locker)
        with multiprocessing.Pool(processes=2) as pool:
            # Submit tasks individually
            result_a = pool.apply_async(lock, [tmpfile, fail_when_locked, flags])
            result_b = pool.apply_async(lock, [tmpfile, fail_when_locked, flags])

            try:
                a = result_a.get(timeout=1.1)  # Wait for 'a' with timeout
            except multiprocessing.TimeoutError:
                a = None

            try:
                # Lower timeout since we already waited with `a`
                b = result_b.get(timeout=0.2)  # Wait for 'b' with timeout
            except multiprocessing.TimeoutError:
                b = None

            assert a or b
            # Make sure a is always filled
            if b:
                b, a = b, a

            print(f'{a=}')
            print(f'{b=}')

            # make pyright happy
            assert a is not None

            if b:
                # make pyright happy
                assert b is not None

                assert not a.exception_class or not b.exception_class
>               assert issubclass(
                    a.exception_class or b.exception_class,  # type: ignore
                    portalocker.LockException,
                )
E               TypeError: issubclass() arg 1 must be a class

portalocker_tests/tests.py:383: TypeError
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Locking /tmp/pytest-of-openhands/pytest-6/test_exclusive_processes_lockf1/4133544850288715 False <built-in function lockf>
a=LockResult(exception_class=None, exception_message=None, exception_repr=None)
b=LockResult(exception_class=None, exception_message=None, exception_repr=None)
=========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================== 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/temporary_file_lock.py::test_temporary_file_lock - AssertionError: assert not True
FAILED portalocker_tests/tests.py::test_exclusive_processes[lockf-False] - TypeError: issubclass() arg 1 must be a class
========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================= 2 failed, 38 passed, 2 skipped, 3 warnings in 19.60s =========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
[The command completed with exit code 1.]
[Current working directory: /workspace/portalocker]
[Python interpreter: /usr/bin/python]
[Command finished with exit code 1]