Skip to content

Windows support: make the test suite CI-green #186

@dfrostar

Description

@dfrostar

Context

The cross-platform CI matrix (#185) ran the full test suite on windows-latest (Python 3.12) for the first time. Result: 509 passed, 5 failed, 134 errors. Linux (3.10–3.12) and macOS (3.12) are fully green; Windows is not. Windows was therefore dropped from the gating matrix and demoted to ⚠️ Experimental in docs/COMPATIBILITY.md, and the schema.org operatingSystem claim was narrowed to "Linux, macOS". This issue tracks getting Windows back to green so it can be re-added to the gate and the support claim restored.

Failing run

What fails on Windows

1. ChromaDB temp-dir teardown — ~134 errors (test-infra)

PermissionError: [WinError 32] The process cannot access the file because it is being used by another process deleting …/neuralmind_db/chroma.sqlite3 and …/data_level0.bin during fixture teardown. ChromaDB keeps the sqlite/HNSW file handles open; Windows refuses to delete an open file, so TemporaryDirectory cleanup blows up after the test body has run.

  • Fix direction: explicitly close/del the Chroma client + collection in test teardown (and likely in GraphEmbedder/backend close()), and/or use tempfile.TemporaryDirectory(ignore_cleanup_errors=True) (Py3.10+) in the shared fixtures. Audit embedder/core/backend for a close() that releases the client.

2. Event-log rotation — 3 failures (likely product code)

tests/test_event_log.py::test_tailer_recovers_from_rotation*PermissionError renaming events.jsonlevents.jsonl.1 while a reader holds it open. POSIX allows rename-over-open; Windows does not.

  • Fix direction: in the tailer/rotation path, close the read handle before rotating (or open with share-delete semantics); make the rotation logic Windows-aware.

3. Concurrent append safety — 1 failure (likely product code)

tests/test_graph_view.py::test_recent_queries_append_is_concurrency_safe — expected 40 appends (8 threads × 5), got 37. Concurrent appends lose writes on Windows; the test asserts concurrency-safety.

  • Fix direction: guard the recent-queries append with a real lock (or O_APPEND-equivalent atomic write) that holds on Windows, not just POSIX atomic-append assumptions.

4. Executable-bit test — 1 failure (test-only, easy)

tests/test_cli.py::test_cmd_init_hook_makes_executable asserts S_IXUSR. Windows has no executable bit.

  • Fix direction: @unittest.skipIf(os.name == "nt", …) or skip via sys.platform.startswith("win").

Done when

  • Items 1–4 fixed
  • windows-latest re-added to the test matrix in .github/workflows/ci.yml and green
  • docs/COMPATIBILITY.md Windows row restored to ✅ Full
  • docs/index.html operatingSystem restored to include Windows

https://claude.ai/code/session_016MZU3vW4yd4SJeA293foF3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentationenhancementNew feature or requestquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions