Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failure on Windows on a os.symlink() call #460

Closed
jonasmalacofilho opened this issue May 28, 2022 · 1 comment
Closed

Test failure on Windows on a os.symlink() call #460

jonasmalacofilho opened this issue May 28, 2022 · 1 comment
Labels
bug Apparent bug in liquidctl windows Windows users are particularly affected

Comments

@jonasmalacofilho
Copy link
Member

jonasmalacofilho commented May 28, 2022

Reported by: @jmarucha

The test_fs_backend_load_store_loads_from_fallback_dir_that_is_symlink1 test fails on Windows with OSError: [WinError 1314] A required privilege is not held by the client on a os.symlink() call.

> python -m venv venv
> venv\Scripts\python -m pip install --upgrade colorlog docopt hidapi pytest pyusb setuptools setuptools_scm
[ ... ]
> venv\Scripts\python -m pip install --upgrade "libusb-package; sys_platform == 'win32' or sys_platform == 'cygwin'"
[ ... ]
> venv\Scripts\python.exe -m pytest
================================================= test session starts =================================================
platform win32 -- Python 3.10.2, pytest-7.1.2, pluggy-1.0.0
rootdir: C:\Users\dad\Documents\liquidctl, configfile: pyproject.toml
collected 362 items

liquidctl\pmbus.py ...                                                                                           [  0%]
liquidctl\util.py ...........                                                                                    [  3%]
tests\test_api.py ...                                                                                            [  4%]
tests\test_asetek.py ............                                                                                [  8%]
tests\test_asetek_pro.py ......                                                                                  [  9%]
tests\test_aura_led.py ........                                                                                  [ 11%]
tests\test_backward_compatibility_10.py .                                                                        [ 12%]
tests\test_backward_compatibility_11.py .                                                                        [ 12%]
tests\test_backward_compatibility_12.py .                                                                        [ 12%]
tests\test_backward_compatibility_13.py ..                                                                       [ 13%]
tests\test_backward_compatibility_14.py .....                                                                    [ 14%]
tests\test_backward_compatibility_15.py .                                                                        [ 14%]
tests\test_backward_compatibility_18.py ..                                                                       [ 15%]
tests\test_cli.py ...                                                                                            [ 16%]
tests\test_commander_core.py .........                                                                           [ 18%]
tests\test_commander_pro.py .................................................................................... [ 41%]
.................................                                                                                [ 51%]
tests\test_corsair_hid_psu.py ........                                                                           [ 53%]
tests\test_ddr4.py ............................                                                                  [ 61%]
tests\test_hidapi_device.py .........                                                                            [ 63%]
tests\test_hwmon.py .......                                                                                      [ 65%]
tests\test_hydro_platinum.py .....................                                                               [ 71%]
tests\test_keyval.py .......F....                                                                                [ 74%]
tests\test_kraken2.py ............                                                                               [ 77%]
tests\test_kraken3.py ..........                                                                                 [ 80%]
tests\test_nvidia.py ..........................                                                                  [ 87%]
tests\test_nzxt_epsu.py ..                                                                                       [ 88%]
tests\test_nzxt_h1_v2.py ........                                                                                [ 90%]
tests\test_rgb_fusion2.py ..............                                                                         [ 94%]
tests\test_smart_device.py ........                                                                              [ 96%]
tests\test_smart_device2.py ........                                                                             [ 98%]
tests\test_usb.py ....                                                                                           [100%]

====================================================== FAILURES =======================================================
_________________________ test_fs_backend_load_store_loads_from_fallback_dir_that_is_symlink __________________________

tmpdir = local('C:\\Users\\dad\\AppData\\Local\\Temp\\pytest-of-dad\\pytest-1\\test_fs_backend_load_store_loa1')

    def test_fs_backend_load_store_loads_from_fallback_dir_that_is_symlink(tmpdir):
        # should deadlock if there is a problem with the lock type or with the
        # handling of fallback paths that point to the same principal/write
        # directory

        run_dir = tmpdir.mkdir('run_dir')
        fb_dir = os.path.join(run_dir, 'symlink')
>       os.symlink(run_dir, fb_dir, target_is_directory=True)
E       OSError: [WinError 1314] A required privilege is not held by the client: 'C:\\Users\\dad\\AppData\\Local\\Temp\\pytest-of-dad\\pytest-1\\test_fs_backend_load_store_loa1\\run_dir' -> 'C:\\Users\\dad\\AppData\\Local\\Temp\\pytest-of-dad\\pytest-1\\test_fs_backend_load_store_loa1\\run_dir\\symlink'

tests\test_keyval.py:116: OSError
=============================================== short test summary info ===============================================
FAILED tests/test_keyval.py::test_fs_backend_load_store_loads_from_fallback_dir_that_is_symlink - OSError: [WinError ...
============================================ 1 failed, 361 passed in 9.23s ============================================


Additional information about the system:

  • Affected device(s): N/A
  • Operating system and version: Windows 10 Pro 21H1
  • Liquidctl installation method: git clone
  • Output of liquidctl --version: liquidctl v1.10.0.dev12+g622d83c (Windows-10-10.0.19043-SP0)
@jonasmalacofilho jonasmalacofilho added bug Apparent bug in liquidctl windows Windows users are particularly affected labels May 28, 2022
@jonasmalacofilho
Copy link
Member Author

Thanks to Smjert @ Discord:

Permission to create symlinks is not normally enabled for normal users on Windows. That could be the reason. CI runs as Admin.
More on that: https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/create-symbolic-links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Apparent bug in liquidctl windows Windows users are particularly affected
Projects
None yet
Development

No branches or pull requests

1 participant