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

Function TestTracker_FailRecordsError

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

Source from the content-addressed store, hash-verified

99}
100
101func TestTracker_FailRecordsError(t *testing.T) {
102 t.Parallel()
103
104 errBoom := errors.New("transport reset")
105 tr := lifecycle.NewTracker()
106 tr.Fail(lifecycle.StateRestarting, errBoom)
107
108 snap := tr.Snapshot()
109 assert.Check(t, is.Equal(snap.State, lifecycle.StateRestarting))
110 assert.Check(t, is.Equal(snap.LastError, errBoom))
111}
112
113func TestTracker_RestartCounter(t *testing.T) {
114 t.Parallel()

Callers

nothing calls this directly

Calls 5

FailMethod · 0.95
SnapshotMethod · 0.95
NewTrackerFunction · 0.92
CheckMethod · 0.80
NewMethod · 0.45

Tested by

no test coverage detected