MCPcopy
hub / github.com/google/cadvisor / TestUpdateSubcontainersWithError

Function TestUpdateSubcontainersWithError

lib/manager/container_test.go:102–113  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

100}
101
102func TestUpdateSubcontainersWithError(t *testing.T) {
103 cd, mockHandler, _, _ := newTestContainerData(t)
104 mockHandler.On("ListContainers", container.ListSelf).Return(
105 []info.ContainerReference{},
106 fmt.Errorf("some error"),
107 )
108 mockHandler.On("Exists").Return(true)
109
110 assert.NotNil(t, cd.updateSubcontainers())
111 assert.Empty(t, cd.info.Subcontainers, "subcontainers should not be populated on failure")
112 mockHandler.AssertExpectations(t)
113}
114
115func TestUpdateSubcontainersWithErrorOnDeadContainer(t *testing.T) {
116 cd, mockHandler, _, _ := newTestContainerData(t)

Callers

nothing calls this directly

Calls 3

newTestContainerDataFunction · 0.85
ErrorfMethod · 0.80
updateSubcontainersMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…