test(tui): status_write_is_atomic_under_concurrent_reads fails on Windows with NotFound (rename over a file being read)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
Start with crates/atlas-tui/src/runtime/manager/health_check.rs around the failing test and trace write_status_atomic to atlas_core::fs::write_atomic. Then inspect the .tui-status.json readers used by atlas dev --status and the MCP status tools to see how they handle NotFound. Done means the Windows race is addressed consistently for the test and production readers.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What fails
atlas-tui runtime::manager::health_check::tests::status_write_is_atomic_under_concurrent_reads failed once on Windows with a NotFound from the reader:
FAIL [ 5.473s] (2651/3095) atlas-tui runtime::manager::health_check::tests::status_write_is_atomic_under_concurrent_reads
thread '<unnamed>' (968) panicked at crates\atlas-tui\src\runtime\manager\health_check.rs:653:66:
called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }
thread 'runtime::manager::health_check::tests::status_write_is_atomic_under_concurrent_reads' panicked at health_check.rs:664:31:
called `Result::unwrap()` on an `Err` value: Any { .. }
Evidence: run 44087317372 (a throwaway workflow_dispatch matrix, 2026-11-17), job 134053020665, windows-2022 (image 20261112.366.7), runner GitHub Actions 1000025870, Test step of commit 8019de2f-based branch; 1 failure in 10 jobs of that run (the other 9, 5 of them on windows-2025-vs2026, passed). Not a runner loss: the step ended normally with 3094 passed, 1 failed.
Why it fails
The test has one thread rewrite .tui-status.json 300 times with write_status_atomic (atlas_core::fs::write_atomic: temp file + sync_all + fs::rename over the target) while another thread loops std::fs::read_to_string(path).unwrap() and expects the old or the new content, "never a partial file". On Windows the rename over an existing file that a reader has just opened or is opening can make the target momentarily not resolvable, so the reader gets NotFound (os error 2), which the test's .unwrap() turns into a panic. The Unix rename(2) never has that window.
Why it matters beyond the test
If the cause is the rename, any Windows reader of .tui-status.json (the atlas dev --status / MCP status tools read it while the runner rewrites it) can see a transient NotFound and may report "atlas dev is not running" for an instant. Worth checking the readers' handling together with the fix.
Not done here
No fix attempted (asked to file it). Candidates: make the test retry on NotFound (what the fix of #484/#485 did for similar fsync-speed races) only if the readers in production already tolerate it, or make write_atomic robust on Windows (ReplaceFileW, or a retry of the open in the shared reader).
Found while investigating #520 (runner losses); unrelated to them.
- Ngôn ngữ chính
- Rust
- Star
- 3
- Fork
- 1
- Merge trung bình
- 9 giờ 51 phút
- Pull request đã merge (30 ngày)
- 310
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của codeatlasdev/atlas
-
type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
codeatlasdev/atlas#597 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: ci os: linux type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
codeatlasdev/atlas#496 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: ci type: bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
codeatlasdev/atlas#596 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
os: linux type: bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
codeatlasdev/atlas#591 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
flaky: Windows scripts job hits test timeouts (check-dco, i18n runner/translate, check-changed)Đang mởarea: ci os: windows type: bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 56/100
codeatlasdev/atlas#550 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của codeatlasdev/atlas
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
tinystream-dev/tinystream#132 ·
-
contract good first issue testing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Emmyt24/nova-launch#2436 ·
Maintainer thường phản hồi trong vòng 1 ngày