diff --git a/pkg/systemlogmonitor/log_monitor_test.go b/pkg/systemlogmonitor/log_monitor_test.go index d4f9af30..a10ab7b6 100644 --- a/pkg/systemlogmonitor/log_monitor_test.go +++ b/pkg/systemlogmonitor/log_monitor_test.go @@ -17,15 +17,10 @@ limitations under the License. package systemlogmonitor import ( - "fmt" "reflect" - "runtime" "testing" "time" - "github.com/stretchr/testify/assert" - - watchertest "k8s.io/node-problem-detector/pkg/systemlogmonitor/logwatchers/testing" logtypes "k8s.io/node-problem-detector/pkg/systemlogmonitor/types" "k8s.io/node-problem-detector/pkg/types" "k8s.io/node-problem-detector/pkg/util" @@ -143,13 +138,3 @@ func TestGenerateStatus(t *testing.T) { } } } - -func TestGoroutineLeak(t *testing.T) { - orignal := runtime.NumGoroutine() - f := watchertest.NewFakeLogWatcher(10) - f.InjectError(fmt.Errorf("unexpected error")) - l := &logMonitor{watcher: f} - _, err := l.Start() - assert.Error(t, err) - assert.Equal(t, orignal, runtime.NumGoroutine()) -} diff --git a/pkg/systemlogmonitor/logwatchers/filelog/log_watcher_test.go b/pkg/systemlogmonitor/logwatchers/filelog/log_watcher_test.go index b4020335..5b6652df 100644 --- a/pkg/systemlogmonitor/logwatchers/filelog/log_watcher_test.go +++ b/pkg/systemlogmonitor/logwatchers/filelog/log_watcher_test.go @@ -19,7 +19,6 @@ package filelog import ( "io/ioutil" "os" - "runtime" "testing" "time" @@ -180,16 +179,3 @@ Jan 2 03:04:05 kernel: [2.000000] 3 } } } - -func TestGoroutineLeak(t *testing.T) { - orignal := runtime.NumGoroutine() - w := NewSyslogWatcherOrDie(types.WatcherConfig{ - Plugin: "filelog", - PluginConfig: getTestPluginConfig(), - LogPath: "/not/exist/path", - Lookback: "10m", - }) - _, err := w.Watch() - assert.Error(t, err) - assert.Equal(t, orignal, runtime.NumGoroutine()) -}