File tree Expand file tree Collapse file tree 2 files changed +0
-29
lines changed
Expand file tree Collapse file tree 2 files changed +0
-29
lines changed Original file line number Diff line number Diff line change @@ -17,15 +17,10 @@ limitations under the License.
1717package systemlogmonitor
1818
1919import (
20- "fmt"
2120 "reflect"
22- "runtime"
2321 "testing"
2422 "time"
2523
26- "github.com/stretchr/testify/assert"
27-
28- watchertest "k8s.io/node-problem-detector/pkg/systemlogmonitor/logwatchers/testing"
2924 logtypes "k8s.io/node-problem-detector/pkg/systemlogmonitor/types"
3025 "k8s.io/node-problem-detector/pkg/types"
3126 "k8s.io/node-problem-detector/pkg/util"
@@ -143,13 +138,3 @@ func TestGenerateStatus(t *testing.T) {
143138 }
144139 }
145140}
146-
147- func TestGoroutineLeak (t * testing.T ) {
148- orignal := runtime .NumGoroutine ()
149- f := watchertest .NewFakeLogWatcher (10 )
150- f .InjectError (fmt .Errorf ("unexpected error" ))
151- l := & logMonitor {watcher : f }
152- _ , err := l .Start ()
153- assert .Error (t , err )
154- assert .Equal (t , orignal , runtime .NumGoroutine ())
155- }
Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ package filelog
1919import (
2020 "io/ioutil"
2121 "os"
22- "runtime"
2322 "testing"
2423 "time"
2524
@@ -180,16 +179,3 @@ Jan 2 03:04:05 kernel: [2.000000] 3
180179 }
181180 }
182181}
183-
184- func TestGoroutineLeak (t * testing.T ) {
185- orignal := runtime .NumGoroutine ()
186- w := NewSyslogWatcherOrDie (types.WatcherConfig {
187- Plugin : "filelog" ,
188- PluginConfig : getTestPluginConfig (),
189- LogPath : "/not/exist/path" ,
190- Lookback : "10m" ,
191- })
192- _ , err := w .Watch ()
193- assert .Error (t , err )
194- assert .Equal (t , orignal , runtime .NumGoroutine ())
195- }
You can’t perform that action at this time.
0 commit comments