Unit suite cannot run on Windows: 9 failures from POSIX-only test scaffolding

Author: rajarshidattapyCreated Aug 29, 2026Updated Aug 29, 2026

Labels: bug, windows, tests

Description

Windows is a supported platform (the codebase has TCP-loopback IPC, tasklist probes, a ctypes GetProcessTimes path, and CREATE_NO_WINDOW spawn flags specifically for it), but the unit suite cannot be run there. A clean checkout on Windows gives:

$ python -m pytest tests -q
9 failed, 159 passed in 9.40s

FAILED tests/unit/test_admin.py::test_cleanup_unattached_browser_launch_stops_posix_process_group
FAILED tests/unit/test_admin.py::test_cleanup_unattached_browser_launch_keeps_cdp_browser
FAILED tests/unit/test_admin.py::test_explicit_chrome_path_retains_matching_profile_on_linux[BH_CHROME_PATH]
FAILED tests/unit/test_admin.py::test_explicit_chrome_path_retains_matching_profile_on_linux[CHROME_PATH]
FAILED tests/unit/test_admin.py::test_explicit_chrome_path_remains_unowned_without_platform_cleanup[Darwin]
FAILED tests/unit/test_admin.py::test_explicit_chrome_path_remains_unowned_without_platform_cleanup[Windows]
FAILED tests/unit/test_admin.py::test_doctor_probe_preserves_snap_bin_env_symlink
FAILED tests/unit/test_admin.py::test_doctor_probe_preserves_snap_bin_path_symlink
FAILED tests/unit/test_skill.py::test_packaged_skill_frontmatter_is_valid_simple_yaml

Causes

Three distinct ones:

  1. os.killpg monkeypatch (6 tests). tests/unit/test_admin.py does monkeypatch.setattr(admin.os, "killpg", ...). os.killpg does not exist on Windows, and monkeypatch.setattr refuses to create a missing attribute:

    E  AttributeError: <module 'os' (frozen)> has no attribute 'killpg'

    Note these tests are about POSIX behaviour — two of them are even parametrised [Darwin]/[Windows] — so they should be exercising the Windows branch of _cleanup_unattached_browser_launch() (process.terminate()), not the POSIX one.

  2. Path.symlink_to (2 tests). The snap-probe tests build a /snap/bin/chromium/usr/bin/snap symlink chain in tmp_path:

    E  OSError: [WinError 1314] A required privilege is not held by the client
  3. test_skill.py — separate root cause, tracked in the SKILL.md symlink issue.

Suggested fix

  • Use monkeypatch.setattr(admin.os, "killpg", ..., raising=False), and add the Windows-branch assertion the [Windows] parametrisation implies.
  • Guard the symlink tests with @pytest.mark.skipif(sys.platform == "win32", ...), or create the symlink inside a try/except OSError: pytest.skip(...).

Pair this with a Windows CI leg so it stays fixed.

Environment

  • Windows 11, Python 3.11.9, pip install -e . + pytest, main @ e3e8069

Source: browser-use/browser-harness