From b33e82e3925de617a29fc495dc6e0a5d12b57150 Mon Sep 17 00:00:00 2001 From: TINGyu123644 <2663180454@qq.com> Date: Tue, 6 Oct 2026 17:15:06 +0800 Subject: [PATCH] fix(tests): skip MAX_PATH-exceeding blocking-io anchors on Windows (#6361) * test(skills): skip MAX_PATH-exceeding anchors on Windows (ref #6353) * test(skills): skip MAX_PATH-exceeding anchors on Windows (ref #6353) * test(skills): skip MAX_PATH-exceeding anchors on Windows (ref #6353) * style(tests): fix import order in project blocking-io tests * fix(tests): narrow Windows MAX_PATH skip to only the two failing attach anchors Per review: module-level skip also skipped ingestion/thread-files anchors that are not MAX_PATH-bound. Now only the two attach staging anchors skip on Windows. --------- Co-authored-by: Willem Jiang --- .../tests/blocking_io/test_project_documents.py | 10 +++++++++- .../test_project_documents_promotion.py | 14 +++++++++++++- backend/tests/blocking_io/test_project_trash.py | 10 +++++++++- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/backend/tests/blocking_io/test_project_documents.py b/backend/tests/blocking_io/test_project_documents.py index 6dc8de42ca..c05c66a736 100644 --- a/backend/tests/blocking_io/test_project_documents.py +++ b/backend/tests/blocking_io/test_project_documents.py @@ -20,6 +20,7 @@ from __future__ import annotations import functools import json +import os from types import SimpleNamespace import pytest @@ -32,7 +33,14 @@ from deerflow.projects.tools import _read_project_document_impl from deerflow.runtime.context_keys import PROJECT_CONTEXT_KEY from deerflow.utils.file_io import run_file_io as _real_run_file_io -pytestmark = [pytest.mark.asyncio, pytest.mark.allow_blocking_io] +pytestmark = [ + pytest.mark.asyncio, + pytest.mark.allow_blocking_io, + pytest.mark.skipif( + os.name == "nt", + reason="project-document anchors exceed Windows MAX_PATH (WinError 206); see #6353", + ), +] _USER = "u1" diff --git a/backend/tests/blocking_io/test_project_documents_promotion.py b/backend/tests/blocking_io/test_project_documents_promotion.py index 9039e95157..98b94ad15b 100644 --- a/backend/tests/blocking_io/test_project_documents_promotion.py +++ b/backend/tests/blocking_io/test_project_documents_promotion.py @@ -13,6 +13,7 @@ an offload drops the dispatch and turns the anchor red. from __future__ import annotations import functools +import os from types import SimpleNamespace import pytest @@ -22,7 +23,10 @@ from deerflow.persistence.projects import ProjectDocumentRepository, ProjectRepo from deerflow.projects.documents import add_staged_document, read_file_chunks, stage_document_bytes, stage_document_copy_for_attach from deerflow.utils.file_io import run_file_io as _real_run_file_io -pytestmark = [pytest.mark.asyncio, pytest.mark.allow_blocking_io] +pytestmark = [ + pytest.mark.asyncio, + pytest.mark.allow_blocking_io, +] _USER = "u1" @@ -60,6 +64,10 @@ async def _shelf_document(env) -> dict: return result[0] +@pytest.mark.skipif( + os.name == "nt", + reason="attach staging copy/read exceed Windows MAX_PATH (WinError 206); see #6353", +) async def test_attach_staging_copy_dispatches_off_the_loop(tmp_path, monkeypatch) -> None: """The under-lock source copy (existence/size check + ``shutil.copyfile``) must go through ``run_file_io`` while the row lock is held.""" @@ -79,6 +87,10 @@ async def test_attach_staging_copy_dispatches_off_the_loop(tmp_path, monkeypatch await close_engine() +@pytest.mark.skipif( + os.name == "nt", + reason="attach staging copy/read exceed Windows MAX_PATH (WinError 206); see #6353", +) async def test_attach_staged_read_dispatches_off_the_loop(tmp_path, monkeypatch) -> None: """``read_file_chunks`` (attach ingestion source + from-thread promote source) must dispatch the open, every chunk read, and the close through diff --git a/backend/tests/blocking_io/test_project_trash.py b/backend/tests/blocking_io/test_project_trash.py index af58956f14..7a40948b6c 100644 --- a/backend/tests/blocking_io/test_project_trash.py +++ b/backend/tests/blocking_io/test_project_trash.py @@ -11,6 +11,7 @@ anchor red (mutation-verified style of this suite). from __future__ import annotations import functools +import os from types import SimpleNamespace import pytest @@ -21,7 +22,14 @@ from deerflow.projects.documents import add_staged_document, converted_markdown_ from deerflow.projects.trash import make_purge_file_remover, purge_all_trashed, restore_document, run_trash_retention_sweep from deerflow.utils.file_io import run_file_io as _real_run_file_io -pytestmark = [pytest.mark.asyncio, pytest.mark.allow_blocking_io] +pytestmark = [ + pytest.mark.asyncio, + pytest.mark.allow_blocking_io, + pytest.mark.skipif( + os.name == "nt", + reason="project-document anchors exceed Windows MAX_PATH (WinError 206); see #6353", + ), +] _USER = "u1"