From 2815f4fc40ca14ffb8a1a98ba16d7b1fbe77c0ac Mon Sep 17 00:00:00 2001 From: Vihas Makwana Date: Tue, 10 Dec 2024 13:37:43 +0530 Subject: [PATCH] fix: update tests --- metric/cpu/metric_windows_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/metric/cpu/metric_windows_test.go b/metric/cpu/metric_windows_test.go index 3cfaf75cc..a9aab4925 100644 --- a/metric/cpu/metric_windows_test.go +++ b/metric/cpu/metric_windows_test.go @@ -28,7 +28,7 @@ import ( ) func TestCounterLength(t *testing.T) { - monitor, err := New(systemtests.DockerTestResolver()) + monitor, err := New(systemtests.DockerTestResolver(), WithWindowsPerformanceCounter()) require.NoError(t, err) require.NoError(t, monitor.query.CollectData()) @@ -52,3 +52,9 @@ func TestCounterLength(t *testing.T) { require.Equal(t, kernelRawData[i].InstanceName, idleRawData[i].InstanceName, "InstanceName should be equal") } } + +func TestCounterDisabled(t *testing.T) { + monitor, err := New(systemtests.DockerTestResolver(), WithWindowsPerformanceCounter()) + require.NoError(t, err) + require.Nil(t, monitor.query) +}