From 012d237a930fe349286e95ffae7ce909ad6eeb4e Mon Sep 17 00:00:00 2001 From: Weizhen Wang Date: Mon, 26 Dec 2022 19:01:10 +0800 Subject: [PATCH] improve code Signed-off-by: Weizhen Wang --- util/cpu/cpu_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util/cpu/cpu_test.go b/util/cpu/cpu_test.go index cefa1073402b5..a191227b72f78 100644 --- a/util/cpu/cpu_test.go +++ b/util/cpu/cpu_test.go @@ -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++ { @@ -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() }