automated testing for action invariants

Abierto
#31 2 comentarios 2 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Nueva funcionalidad
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
rust

Línea de trabajo

Comienza revisando las APIs de action y undo-action existentes de Steno, ya que el issue no indica archivos ni tests específicos. Determina cómo podrían los consumidores informar de un estado externo equivalente e inyectar errores reintentables. Se considerará terminado cuando haya cobertura automatizada para actions repetidas, undo-actions repetidas, el comportamiento de action después de undo-action y fallos inyectados.

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

Descripción

Steno expects action implementations to meet a few invariants (these come from distributed sagas in general):

  • actions are idempotent
  • undo actions are idempotent
  • "undo" should be commutative with the action. That is, if an undo action is executed followed by a re-execution of the action itself, the net result should be as though the undo action ran last.
  • what others?

We cannot test that actions are correct or even that they always obey these invariants. But we could empirically test a lot of different cases, like:

  • after an action runs to completion, run it again. It should succeed again and the resulting external state should be equivalent. (Steno can't know the second part but the consumer can help here.)
  • after an undo action runs to completion, run it again. It should succeed again and the external state should be equivalent.
  • run the action again after the undo action completes. It should succeed again and the external state should be equivalent.

If we could inject a retryable error into either the action or undo action, then we could also test that they can fail (multiple times in a row), then remove the injected error, and then run it again and have them succeed.

All of this requires that the consumer be able to tell us whether the external states of the world are equivalent (or, maybe equivalently, whether they've changed).

Lenguaje dominante
Rust
Estrellas
174
Forks
15
Merge medio
1 d 23 h
PR fusionados (30 d)
8

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

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 oxidecomputer/steno

Todos los issues de oxidecomputer/steno

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.