mirror of
https://github.com/kubernetes/node-problem-detector.git
synced 2026-03-06 03:30:26 +00:00
fix data race
This commit is contained in:
@@ -18,7 +18,7 @@ package kernelmonitor
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
//"os"
|
||||
"reflect"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -100,15 +100,14 @@ func TestWatch(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer func() {
|
||||
os.Remove(f.Name())
|
||||
f.Close()
|
||||
//os.Remove(f.Name())
|
||||
}()
|
||||
_, err = f.Write([]byte(test.log))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
f.Close()
|
||||
|
||||
w := NewKernelLogWatcher(WatcherConfig{KernelLogPath: f.Name(), Lookback: test.lookback})
|
||||
// Set the fake clock.
|
||||
w.(*kernelLogWatcher).clock = fakeClock
|
||||
|
||||
Reference in New Issue
Block a user