f514d546be
The real-handle tests use @pytest.mark.windows_only rather than a bare pytest.skip(os.name != 'nt'). scripts/ci/list_os_marked_tests.py greps for the marker NAME to decide which files the Windows lane imports, so a plain skipif leaves a Windows test running on no host at all — green over zero coverage, which is what AGENTS.md warns about. Cross-platform tests simulate winerror 5 (what a held target actually raises) rather than 32, and pin the state machine: retry-then-rewrite for each contention code, an in-budget retry keeping the write atomic with no fallback, a genuine denial propagating after the budget with its temp file intact, a retry that turns into EXDEV switching to the copy fallback, ENOSPC and POSIX EACCES propagating with no retry at all, the rewrite never exposing a truncated file, and the #16743 symlink invariant holding on the contended path. On native Windows the lane exercises real held handles end to end, and pins the winerror-5 premise so a CPython change surfaces here instead of silently reintroducing the bug. Co-authored-by: LewfKrad <lEWFkRAD@users.noreply.github.com> Co-authored-by: ruochu88s <ruochu88s@users.noreply.github.com> Co-authored-by: lost9999 <lost9999@users.noreply.github.com> Co-authored-by: guanla-zz <guanla-zz@users.noreply.github.com> Co-authored-by: zapabob <zapabob@users.noreply.github.com>