diff --git a/pkg/kubelet/winstats/perfcounter_nodestats_test.go b/pkg/kubelet/winstats/perfcounter_nodestats_test.go index 4ae39d55999..a16393b18f1 100644 --- a/pkg/kubelet/winstats/perfcounter_nodestats_test.go +++ b/pkg/kubelet/winstats/perfcounter_nodestats_test.go @@ -143,8 +143,9 @@ func TestCollectMetricsData(t *testing.T) { memoryPrivWorkingSetBytes: 2, memoryCommittedBytes: 3, interfaceStats: networkAdapterCounter.listInterfaceStats(), - timeStamp: time.Now(), } + assert.WithinDuration(t, time.Now(), metrics.timeStamp, 20*time.Millisecond) + expectedMetrics.timeStamp = metrics.timeStamp assert.Equal(t, expectedMetrics, metrics) }