rewrite: the CLOSE-during-mint test's yield poll can accuse the code, and its comment understates its coverage
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
閱讀 crates/nostream-relay/src/testing.rs,以及 crates/nostream-relay/tests/handlers.rs 中的測試 a_close_during_the_invite_mint_leaves_the_event_but_not_the_read。將有界的 yield 迴圈替換為 Tokio 通知或測試替身在開始建立 mint 時發出的 oneshot 訊號。完成標準是:測試等待該訊號,並繼續驗證進行中的 mint 行為,同時不依賴排程器設定迭代次數上限。
由索引模型根據 Issue 內容生成。
描述
a_close_during_the_invite_mint_leaves_the_event_but_not_the_read (crates/nostream-relay/tests/handlers.rs) waits for the spawned mint to reach its held await with
for _ in 0..100 {
if fixture.invites.creates_started() == 1 { break; }
tokio::task::yield_now().await;
}
assert_eq!(fixture.invites.creates_started(), 1, "the invite mint is in flight");
The loop is deterministic in the sense that matters — it cannot make the property pass late, because the property is asserted after the abort and the release is program-ordered, and a mint that never starts fails the assertion with a message rather than hanging. But a fixed iteration bound is a (small) flake source: on a loaded runner, 100 scheduler opportunities may not be enough for a spawned task to start, and the failure would look like the defect the test exists to catch.
What it needs
The test double already counts creates_started(); give it a notification as well — a tokio::sync::Notify or a oneshot fired when the mint first awaits — and await that instead of polling. Then the wait is on a state the code signals, not on the scheduler being generous.
Test support only (crates/nostream-relay/src/testing.rs), no production change. Same class as the abort observable #963's spec considered: the double should be able to say what it is doing rather than being sampled.
- 主要語言
- TypeScript
- 星號
- 829
- 分支
- 234
- 平均合併
- 17 小時 6 分鐘
- 30 天內合併 PR
- 92
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
cameri/nostream 的其他 Issue
-
factory rewrite rust
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
test: user-subscription specs fail outside UTC, so the pre-commit hook cannot pass可能已有人在做 @tejasvasingh2004 於 1 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
bug factory rewrite rust
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
bug factory rewrite rust
難度 2/5 1-3 小時 新手友好度 84/100
維護者通常 1 天內回覆
-
bug factory rewrite rust
難度 2/5 1-3 小時 新手友好度 77/100
維護者通常 1 天內回覆
相似的 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 68/100
outline/outline#14348 · 1 則留言 ·
維護者通常 1 天內回覆
-
bug needs-triage
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
[Bug]: Agent import retains quotes in .env API keys followed by inline comments可能已有人在做 @yxr-2025 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 82/100
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 76/100
awslabs/visual-asset-management-system#804 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 68/100
dsh-market/dsh-market#1027 · 1 則留言 ·
維護者通常 1 天內回覆