Reconcile goal recovery with human intent and model state transitions
This commit is contained in:
parent
e4b84d9802
commit
548eb69211
1 changed files with 1765 additions and 96 deletions
|
|
@ -120,14 +120,14 @@ func TestSchedule(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestChangedBlock(t *testing.T) {
|
||||
func TestSnapshotReset(t *testing.T) {
|
||||
w := failedWatch()
|
||||
w.Failures = 3
|
||||
w.Due = time.Now()
|
||||
g := testGoal(blocked)
|
||||
g.UpdatedAt++
|
||||
w.update(g)
|
||||
if w.eligible() || !w.Due.IsZero() {
|
||||
t.Fatal("resumed a changed blocked goal")
|
||||
w.update(testGoal(active))
|
||||
w.observe(turn{ID: "turn-2", Status: "completed"})
|
||||
if w.Failures != 0 || !w.Due.IsZero() || w.eligible() {
|
||||
t.Fatalf("successful snapshot retained recovery state: %+v", w)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue