Remove TestGoroutineLeak unit tests.

We are seeing some flakes on these tests because some goroutine
fluctuation:
https://github.com/kubernetes/node-problem-detector/pull/275#issuecomment-499306727

Removing the tests, as it's robust to test leakage in a soak/stress
test, rather than unit test.
This commit is contained in:
Xuewei Zhang
2019-05-20 17:16:50 -07:00
parent 831f7fbd75
commit c6c4e80c9d
2 changed files with 0 additions and 29 deletions

View File

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

View File

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