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:
Ed Bartosh 2024-11-27 17:11:04 +02:00
parent f622be0333
commit 48ea6fc465

View File

@ -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)