Skip to content

Commit

Permalink
improve code
Browse files Browse the repository at this point in the history
Signed-off-by: Weizhen Wang <[email protected]>
  • Loading branch information
hawkingrei committed Dec 26, 2022
1 parent 5711050 commit 012d237
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions util/cpu/cpu_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
)

func TestCPUValue(t *testing.T) {
Observer := NewCPUObserver()
observer := NewCPUObserver()
exit := make(chan struct{})
var wg sync.WaitGroup
for i := 0; i < 10; i++ {
Expand All @@ -41,11 +41,11 @@ func TestCPUValue(t *testing.T) {
}
}()
}
Observer.Start()
observer.Start()
time.Sleep(5 * time.Second)
require.GreaterOrEqual(t, GetCPUUsage(), 0.0)
require.Less(t, GetCPUUsage(), 1.0)
Observer.Stop()
observer.Stop()
close(exit)
wg.Wait()
}

0 comments on commit 012d237

Please sign in to comment.