(t *testing.T)
| 74 | } |
| 75 | |
| 76 | func TestTracker_SetClearsError(t *testing.T) { |
| 77 | t.Parallel() |
| 78 | |
| 79 | tr := lifecycle.NewTracker() |
| 80 | tr.Fail(lifecycle.StateRestarting, errors.New("boom")) |
| 81 | assert.Check(t, tr.LastError() != nil) |
| 82 | |
| 83 | tr.Set(lifecycle.StateReady) |
| 84 | assert.Check(t, is.Equal(tr.State(), lifecycle.StateReady)) |
| 85 | assert.Check(t, is.Nil(tr.LastError())) |
| 86 | } |
| 87 | |
| 88 | func TestTracker_SetSameStateIsNoop(t *testing.T) { |
| 89 | t.Parallel() |