mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 11:13:48 +00:00
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)) ^
This commit is contained in:
parent
f622be0333
commit
48ea6fc465
@ -27,6 +27,7 @@ import (
|
||||
|
||||
"github.com/google/cadvisor/utils/oomparser"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
type fakeStreamer struct {
|
||||
@ -65,7 +66,7 @@ func TestWatcherRecordsEventsForOomEvents(t *testing.T) {
|
||||
recorder: fakeRecorder,
|
||||
oomStreamer: fakeStreamer,
|
||||
}
|
||||
assert.NoError(t, oomWatcher.Start(tCtx, node))
|
||||
require.NoError(t, oomWatcher.Start(tCtx, node))
|
||||
|
||||
eventsRecorded := getRecordedEvents(fakeRecorder, numExpectedOomEvents)
|
||||
assert.Len(t, eventsRecorded, numExpectedOomEvents)
|
||||
@ -125,7 +126,7 @@ func TestWatcherRecordsEventsForOomEventsCorrectContainerName(t *testing.T) {
|
||||
recorder: fakeRecorder,
|
||||
oomStreamer: fakeStreamer,
|
||||
}
|
||||
assert.NoError(t, oomWatcher.Start(tCtx, node))
|
||||
require.NoError(t, oomWatcher.Start(tCtx, node))
|
||||
|
||||
eventsRecorded := getRecordedEvents(fakeRecorder, numExpectedOomEvents)
|
||||
assert.Len(t, eventsRecorded, numExpectedOomEvents)
|
||||
@ -162,7 +163,7 @@ func TestWatcherRecordsEventsForOomEventsWithAdditionalInfo(t *testing.T) {
|
||||
recorder: fakeRecorder,
|
||||
oomStreamer: fakeStreamer,
|
||||
}
|
||||
assert.NoError(t, oomWatcher.Start(tCtx, node))
|
||||
require.NoError(t, oomWatcher.Start(tCtx, node))
|
||||
|
||||
eventsRecorded := getRecordedEvents(fakeRecorder, numExpectedOomEvents)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user