memory: file-lock test "stops refreshing a lock that was broken and re-taken" races its own heartbeat on a slow runner
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ó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 76/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- testing
Hướng nghiên cứu
Bắt đầu với src/memory/__tests__/file-lock.test.ts, trong bài kiểm thử withFileLock có tên “stops refreshing a lock that was broken and re-taken while it ran.” Đọc cách utimes được mô phỏng, spy của readFile và bộ định thời thực phối hợp với nhau, rồi làm cho assertion không phụ thuộc vào lịch chạy của runner. Chạy bài kiểm thử tập trung với verify:no-test-retries; công việc hoàn tất khi bài kiểm thử luôn vượt qua mà không cần chạy lại trên CI chậm.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
src/memory/__tests__/file-lock.test.ts > withFileLock > stops refreshing a lock that was broken and re-taken while it ran (#5418) failed on CI with AssertionError: expected 0 to be greater than 0 (Coverage memory, run 44417378815, job 135201148642, on PR #5628's caught-up head). That PR changes only src/git/; the test is unchanged on v2/main, including after #5623.
Cause
The test runs on real timers (staleMs: 200, so a heartbeat every 100 ms). The first heartbeat's utimes is mocked to replace the lock with another owner's and then resolve replacement. The operation then clears the readFile spy and expects, within a 250 ms sleep, at least one read of the lock: the next heartbeat seeing the new token and stopping.
On a loaded runner (the coverage leg is instrumented), the next heartbeat can read the lock before the operation resumes and clears the spy. That read is wiped, the heartbeat stops as intended, and no further read follows, so the count is 0. The behavior under test is correct; the assertion depends on scheduling.
Expected
The test passes regardless of runner speed, with no retry (verify:no-test-retries). For example: drive the heartbeat with fake timers, or count reads from the moment the replacement is made (inside the mocked utimes) instead of clearing after the operation resumes.
- Ngôn ngữ chính
- TypeScript
- Star
- 92k
- Fork
- 12k
- Merge trung bình
- 3 giờ 46 phút
- Pull request đã merge (30 ngày)
- 206
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 modelcontextprotocol/servers
-
`interface-diff` discards the git error when resolving its default base and reports the wrong causeĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
modelcontextprotocol/servers#5636 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation server-memory v2
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
modelcontextprotocol/servers#5609 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug server-memory v2
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
modelcontextprotocol/servers#5635 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug server-memory v2
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 42/100
modelcontextprotocol/servers#5624 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement v2
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
modelcontextprotocol/servers#5611 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của modelcontextprotocol/servers
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
hurttlocker/o8#6535 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area: backend bug priority: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 92/100
snapotter-hq/SnapOtter#4856 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug follow-up
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
spellshift/realm#2509 ·
Maintainer thường phản hồi trong vòng 1 ngày