Skip to content

fix(tests): skip MAX_PATH-exceeding blocking-io anchors on Windows - #6361

Merged
WillemJiang merged 5 commits into
bytedance:mainfrom
TINGyu123644:fix/windows-maxpath-skip-anchors
Oct 6, 2026
Merged

WillemJiang merged 5 commits into
bytedance:mainfrom
TINGyu123644:fix/windows-maxpath-skip-anchors

Conversation

@TINGyu123644

Copy link
Copy Markdown
Contributor

Closes #6353.

Twelve blocking-io anchors under backend/tests/blocking_io/ fail deterministically on Windows hosts with OSError: [Errno 206] Filename or extension too long before the dispatch under test can run. The anchors exercise the real document layout on disk (users/<uid>/projects/<hash>/documents/<xx>/<sha256>/<id>/original), and under a pytest tmp_path prefix that nesting pushes past the Windows MAX_PATH limit of 260 characters.

This PR applies a shared module-level pytest.mark.skipif(os.name == "nt", ...) marker to the three affected files, matching the host-bound anchor convention already merged in #6257 (and #5931). The anchors keep running on POSIX where they are valuable; on Windows they are skipped so the suite stays green and real regressions stand out.

Verified:

  • All three files compile (python -m py_compile).
  • The skipif marker is module-level and applies to every anchor in each file; POSIX runs are unaffected (markers are no-ops).

No production code changes.

@github-actions github-actions Bot added risk:medium Medium risk: regular code changes size/S PR changes 20-100 lines labels Oct 6, 2026

@willem-bd willem-bd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The approach (skip Windows on the MAX_PATH-bound anchors, keep POSIX running) matches the #6257/#5931 convention and the issue's proposed fix, but the import placement will fail backend CI lint (ruff check enforces isort via backend/ruff.toml) in all three files, and the module-level marker in the promotion file skips two anchors that are not MAX_PATH-bound.

import json
from types import SimpleNamespace

import os

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint: ruff check fails here with I001 (important). backend/ruff.toml selects the I (isort) rules and CI's lint-backend job runs make lint on every PR, so this import block fails CI: import os must sit with the other stdlib straight imports (import functools / import os / from types import SimpleNamespace), not after the from types import. Verified by running ruff 0.15.12 with the repo config against the head revision of this file. Fix: move the import up (or run make format).

import functools
from types import SimpleNamespace

import os

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint: ruff check fails here with I001 (important). Same issue as the other two files: import os belongs next to import functools in the stdlib section, and CI's lint-backend job (which runs make lint with the I rules from backend/ruff.toml) will fail on this. Fix: move the import up (or run make format).

import functools
from types import SimpleNamespace

import os

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint: ruff check fails here with I001 (important). Same issue as the other two files: import os must be sorted with the other stdlib straight imports (import functools / import os / from types import SimpleNamespace); the current placement fails CI lint. Fix: move the import up (or run make format).

pytestmark = [
pytest.mark.asyncio,
pytest.mark.allow_blocking_io,
pytest.mark.skipif(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: this module-level skip also skips two anchors that are not MAX_PATH-bound. Issue #6353 lists exactly 2 of this file's 4 anchors as failing on Windows (test_attach_staging_copy_dispatches_off_the_loop, test_attach_staged_read_dispatches_off_the_loop). test_ingestion_open_and_link_commit_dispatch_off_the_loop and test_thread_files_listing_dispatches_off_the_loop exercise the shallow uploads/thread-files layout (not the deep users/<uid>/projects/<hash>/documents/... shelf) and reportedly pass on Windows, but a module-level pytestmark silently drops their Windows coverage too. Consider per-anchor @pytest.mark.skipif(os.name == "nt", ...) decorators on just the 12 MAX_PATH-bound anchors, matching the convention merged in #6257 (which skipped only the affected tests).

WillemJiang and others added 2 commits October 6, 2026 16:04
…ch 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.
@TINGyu123644

Copy link
Copy Markdown
Contributor Author

Thanks for the detailed review! Addressed both points:

  1. Narrowed the Windows skip in test_project_documents_promotion.py: removed the module-level pytestmark.skipif and moved it to only the two anchors listed in [bug] Twelve blocking-io project-document anchors exceed Windows MAX_PATH under pytest tmp_path (WinError 206) #6353 (test_attach_staging_copy_dispatches_off_the_loop and test_attach_staged_read_dispatches_off_the_loop). The ingestion-open/commit and thread-files-listing anchors now run on all platforms as intended.

  2. Import placement: confirmed import os sits in the stdlib straight-imports block (before from types import SimpleNamespace) in all three files. If ruff check still flags I001 on CI, happy to run make format and push again.

Commit: 96ffc8c.

@TINGyu123644

Copy link
Copy Markdown
Contributor Author

Hi @willem-bd — I've pushed the fix (commit 96ffc8ca7adb): the Windows skip is now narrowed to only the two MAX_PATH-bound anchors in the promotion file, and the import placement is confirmed in all three files. The CI workflows (Lint Check / Backend Blocking IO / Unit Tests / Frontend Unit Tests) are showing action_required — could you approve them to run? Happy to address anything else that comes up. Thanks!

@WillemJiang
WillemJiang merged commit b33e82e into bytedance:main Oct 6, 2026
14 checks passed
@WillemJiang WillemJiang added this to the 2.2.0 milestone Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:medium Medium risk: regular code changes size/S PR changes 20-100 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Twelve blocking-io project-document anchors exceed Windows MAX_PATH under pytest tmp_path (WinError 206)

3 participants