e2e: TestFinaliseResumesAtEveryStep pins the finaliser's order (the outcome before the release, the release before it is recorded)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
1 file changed,
+15
−0
internal/e2e/selfserve/cut_test.go+15 −0
diff --git a/internal/e2e/selfserve/cut_test.go b/internal/e2e/selfserve/cut_test.go| index 5cd28ad3c..56be85c0f 100644 |
| --- a/internal/e2e/selfserve/cut_test.go |
| +++ b/internal/e2e/selfserve/cut_test.go |
| @@ -541,6 +541,21 @@ func TestFinaliseResumesAtEveryStep(t *testing.T) { |
| r := w.cutTo("finishing") |
| w.crashWhen = func(p string, _ *console.SelfServeMove) bool { return p == point } |
| w.run(60, "the crash", r.ID, func(*console.SelfServeMove) bool { return w.crashWhen == nil }) |
| + // The order: the outcome is durable before the reservations |
| + // go, and they go before the release is recorded. |
| + at := w.row(r.ID) |
| + switch point { |
| + case "finalise:outcome", "finalise:effects", "finalise:release": |
| + if !w.reservedBy(r.ID) { |
| + t.Fatalf("released before %s: %s", point, describe(at)) |
| + } |
| + } |
| + if point != "finalise:outcome" && at.Outcome == "" { |
| + t.Fatalf("at %s the row has no outcome yet", point) |
| + } |
| + if point == "finalise:outcome" && at.Outcome != "" { |
| + t.Fatalf("the outcome was written before %s", point) |
| + } |
| w.restart() |
| r = w.done(r.ID) |
| if r.Outcome != "done" || len(w.reservations()) != 0 { |