Skip to content

Windows CI: SQLite test-teardown file locking (WinError 32) #5

@InfantLab

Description

@InfantLab

Context

Surfaced while getting CI green for the JOSS review (PR #4). Once torch was pinned so the suite actually runs on Windows, the test (windows-latest) leg shows ~54 errors, all the same root cause:

PermissionError: [WinError 32] The process cannot access the file because it is
being used by another process: '...\test_jobs.db'

Affected areas: tests/unit/worker/test_job_processor.py, tests/integration/test_storage_paths.py, tests/integration/test_storage_provider_integration.py, tests/api/test_api_server.py.

Cause

On Windows a file cannot be deleted/replaced while a handle is open. The SQLAlchemy engine/connection backing the *.db test fixtures is not disposed before the temp directory is torn down, so cleanup fails. This is a test-teardown / resource-lifecycle issue, not a functional bug — ubuntu and macOS pass.

Suggested fix

  • Dispose the engine (engine.dispose()) / close sessions in the relevant fixtures before the tmp_path / TemporaryDirectory cleanup runs.
  • Consider a shared fixture that owns the DB engine lifecycle so teardown order is guaranteed.

Interim

The Windows matrix leg is marked continue-on-error so it is informational and does not block CI (see .github/workflows/ci-cd.yml). ubuntu + macOS gate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions