@@ -32,7 +32,6 @@ import (
32
32
"github.com/google/cadvisor/info/v2"
33
33
"github.com/google/cadvisor/utils/sysfs/fakesysfs"
34
34
"github.com/stretchr/testify/assert"
35
- "github.com/stretchr/testify/require"
36
35
)
37
36
38
37
// TODO(vmarmol): Refactor these tests.
@@ -174,7 +173,9 @@ func TestGetContainerInfoV2(t *testing.T) {
174
173
m , _ , handlerMap := expectManagerWithContainers (containers , query , t )
175
174
176
175
infos , err := m .GetContainerInfoV2 ("/" , options )
177
- require .NoError (t , err , "Error calling GetContainerInfoV2" )
176
+ if err != nil {
177
+ t .Fatalf ("GetContainerInfoV2 failed: %v" , err )
178
+ }
178
179
179
180
for container , handler := range handlerMap {
180
181
handler .AssertExpectations (t )
@@ -205,7 +206,10 @@ func TestGetContainerInfoV2Failure(t *testing.T) {
205
206
m , _ , handlerMap := expectManagerWithContainers (containers , query , t )
206
207
207
208
// Remove /c1 stats
208
- require .NoError (t , m .memoryCache .RemoveContainer (statless ))
209
+ err := m .memoryCache .RemoveContainer (statless )
210
+ if err != nil {
211
+ t .Fatalf ("RemoveContainer failed: %v" , err )
212
+ }
209
213
210
214
// Make GetSpec fail on /c2
211
215
mockErr := fmt .Errorf ("intentional GetSpec failure" )
@@ -216,7 +220,9 @@ func TestGetContainerInfoV2Failure(t *testing.T) {
216
220
m .containers [namespacedContainerName {Name : failing }].lastUpdatedTime = time.Time {} // Force GetSpec.
217
221
218
222
infos , err := m .GetContainerInfoV2 ("/" , options )
219
- assert .Error (t , err , "Expected error calling GetContainerInfoV2" )
223
+ if err == nil {
224
+ t .Error ("Expected error calling GetContainerInfoV2" )
225
+ }
220
226
221
227
// Successful containers still successful.
222
228
info , ok := infos [successful ]
0 commit comments