Skip to content

Commit 48ea6fc

Browse files
committed
oom_watcher: fix testifylint failures
Fixed the following testifylint failures: oom_watcher_linux_test.go:68:2: require-error: for error assertions use require (testifylint) assert.NoError(t, oomWatcher.Start(tCtx, node)) ^ oom_watcher_linux_test.go:128:2: require-error: for error assertions use require (testifylint) assert.NoError(t, oomWatcher.Start(tCtx, node)) ^ oom_watcher_linux_test.go:165:2: require-error: for error assertions use require (testifylint) assert.NoError(t, oomWatcher.Start(tCtx, node)) ^
1 parent f622be0 commit 48ea6fc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pkg/kubelet/oom/oom_watcher_linux_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727

2828
"github.com/google/cadvisor/utils/oomparser"
2929
"github.com/stretchr/testify/assert"
30+
"github.com/stretchr/testify/require"
3031
)
3132

3233
type fakeStreamer struct {
@@ -65,7 +66,7 @@ func TestWatcherRecordsEventsForOomEvents(t *testing.T) {
6566
recorder: fakeRecorder,
6667
oomStreamer: fakeStreamer,
6768
}
68-
assert.NoError(t, oomWatcher.Start(tCtx, node))
69+
require.NoError(t, oomWatcher.Start(tCtx, node))
6970

7071
eventsRecorded := getRecordedEvents(fakeRecorder, numExpectedOomEvents)
7172
assert.Len(t, eventsRecorded, numExpectedOomEvents)
@@ -125,7 +126,7 @@ func TestWatcherRecordsEventsForOomEventsCorrectContainerName(t *testing.T) {
125126
recorder: fakeRecorder,
126127
oomStreamer: fakeStreamer,
127128
}
128-
assert.NoError(t, oomWatcher.Start(tCtx, node))
129+
require.NoError(t, oomWatcher.Start(tCtx, node))
129130

130131
eventsRecorded := getRecordedEvents(fakeRecorder, numExpectedOomEvents)
131132
assert.Len(t, eventsRecorded, numExpectedOomEvents)
@@ -162,7 +163,7 @@ func TestWatcherRecordsEventsForOomEventsWithAdditionalInfo(t *testing.T) {
162163
recorder: fakeRecorder,
163164
oomStreamer: fakeStreamer,
164165
}
165-
assert.NoError(t, oomWatcher.Start(tCtx, node))
166+
require.NoError(t, oomWatcher.Start(tCtx, node))
166167

167168
eventsRecorded := getRecordedEvents(fakeRecorder, numExpectedOomEvents)
168169

0 commit comments

Comments
 (0)