diff --git a/internal/collector/hyperv/hyperv_test.go b/internal/collector/hyperv/hyperv_test.go index 254994ca..b18f4924 100644 --- a/internal/collector/hyperv/hyperv_test.go +++ b/internal/collector/hyperv/hyperv_test.go @@ -40,6 +40,10 @@ func TestCollector(t *testing.T) { testutils.RequireFixtureMetric(t, metrics, hyperv.Name, "windows_hyperv_dynamic_memory_vm_physical_bytes", prometheus.Labels{"vm": "GitHubActions"}) testutils.RequireFixtureMetric(t, metrics, hyperv.Name, "windows_hyperv_vm_processor_count", prometheus.Labels{"vm": "GitHubActions"}) + // An empty "Hyper-V DataStore" counter set is tolerated as an optional + // instance group, so require a series explicitly (#2328). + testutils.RequireFixtureMetric(t, metrics, hyperv.Name, "windows_hyperv_datastore_fragmentation_ratio", nil) + // The fixture VM is not replicated, but every VM has a primary replication relationship. if metric := testutils.RequireFixtureMetric(t, metrics, hyperv.Name, "windows_hyperv_replica_vm_state", prometheus.Labels{"vm": "GitHubActions", "relationship": "primary"}); metric != nil { require.InDelta(t, 0, metric.GetGauge().GetValue(), 0, "expected replication to be disabled")