carlos / platform Public

Clone
git clone https://amadan.net/carlos/platform

Plain git — no account needed to clone.

Download

Download this file

1package rootparticipation
2
3import (
4 "errors"
5 "testing"
6)
7
8func TestPlan14Fix2AcquisitionCommitFailureClearsPending(t *testing.T) {
9 l := censusFixture(t)
10 failure := errors.New("commit failed")
11 if err := l.Acquire(t.Context(), func() error { return failure }); !errors.Is(err, failure) {
12 t.Fatal(err)
13 }
14 c, err := l.Census()
15 if err != nil || c.Pending != "" {
16 t.Fatalf("pending acquisition survived failed commit: %+v %v", c, err)
17 }
18 if err := l.BeginUpdate(t.Context(), "next"); err != nil {
19 t.Fatal("failed acquisition wedged update", err)
20 }
21}
22