automated testing for action invariants

Đang mở
#31 2 bình luận 2 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
rust
Lĩnh vực
distributed-systems

Hướng nghiên cứu

Bắt đầu bằng cách xem xét các API action và undo-action hiện có của Steno, vì issue không nêu các tệp hoặc test cụ thể. Xác định cách consumer có thể báo cáo trạng thái bên ngoài tương đương và chèn các lỗi có thể thử lại. Hoàn thành sẽ bao gồm coverage tự động cho các action lặp lại, các undo-action lặp lại, hành vi action sau undo-action và các lỗi được chèn vào.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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).

Ngôn ngữ chính
Rust
Star
174
Fork
15
Merge trung bình
1 ngày 23 giờ
Pull request đã merge (30 ngày)
8

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của oxidecomputer/steno

Tất cả issue của oxidecomputer/steno

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.