File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -18,11 +18,18 @@ func TestDiskMetricsContent(t *testing.T) {
1818 t .Logf ("Encountered partial errors collecting disk metrics: %v" , errs )
1919 }
2020
21- // Verify that we retrieved at least some metrics
21+ // If there are truly no metrics, or only the default "unknown" entry, skip in this environment.
2222 if len (metricsSlice ) == 0 {
2323 t .Skip ("No disk metrics found. This may indicate restricted disk access or a collection failure." )
2424 }
2525
26+ if len (metricsSlice ) == 1 {
27+ if dd , ok := metricsSlice [0 ].(* metric.DiskData ); ok &&
28+ dd .Device == "unknown" && dd .Mountpoint == "unknown" {
29+ t .Skip ("Only default 'unknown' disk metric returned; disk metrics not available in this environment." )
30+ }
31+ }
32+
2633 foundValidDisk := false
2734
2835 for _ , m := range metricsSlice {
You can’t perform that action at this time.
0 commit comments