MCPcopy
hub / github.com/docker/docker-agent / TestTracker_SetClearsError

Function TestTracker_SetClearsError

pkg/tools/lifecycle/state_test.go:76–86  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

74}
75
76func 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
88func TestTracker_SetSameStateIsNoop(t *testing.T) {
89 t.Parallel()

Callers

nothing calls this directly

Calls 7

FailMethod · 0.95
LastErrorMethod · 0.95
SetMethod · 0.95
StateMethod · 0.95
NewTrackerFunction · 0.92
CheckMethod · 0.80
NewMethod · 0.45

Tested by

no test coverage detected