Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto Apto para principiantes
#991 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
78/100
Tipo de issue
Refactorización
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
rust
Área
testing

Línea de trabajo

Lee crates/nostream-relay/src/testing.rs y la prueba a_close_during_the_invite_mint_leaves_the_event_but_not_the_read en crates/nostream-relay/tests/handlers.rs. Sustituye el bucle acotado de yield por una notificación de Tokio o una señal oneshot del doble de prueba cuando comience la creación del mint. El trabajo estará terminado cuando la prueba espere esa señal y siga verificando el comportamiento del mint en curso, sin un límite de iteraciones que dependa del planificador.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
TypeScript
Estrellas
829
Forks
234
Merge medio
17 h 6 min
PR fusionados (30 d)
92

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de cameri/nostream

Todos los issues de cameri/nostream

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.