Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

rewrite: the CLOSE-during-mint test's yield poll can accuse the code, and its comment understates its coverage

Offen Anfängerfreundlich
#991 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
78/100
Issue-Typ
Refactoring
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
rust
Bereich
testing

Rechercherichtung

Lies crates/nostream-relay/src/testing.rs und den Test a_close_during_the_invite_mint_leaves_the_event_but_not_the_read in crates/nostream-relay/tests/handlers.rs. Ersetze die begrenzte Yield-Schleife durch eine Tokio-Notification oder ein Oneshot-Signal des Test-Doubles, sobald die Mint-Erstellung beginnt. Die Aufgabe ist erledigt, wenn der Test auf dieses Signal wartet und weiterhin das Verhalten des laufenden Mint-Vorgangs überprüft, ohne eine vom Scheduler abhängige Iterationsgrenze.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

factory rewrite rust

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.

Vorherrschende Sprache
TypeScript
Sterne
829
Forks
234
Ø Merge
17 Std. 6 Min.
Gemergte PRs (30 T.)
92

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus cameri/nostream

Alle Issues in cameri/nostream

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.