Skip to content

Commit fc89555

Browse files
committed
Disk test made more assertive
1 parent 9b07a63 commit fc89555

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

test/integration/disk_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ func TestDiskMetricsContent(t *testing.T) {
2020

2121
// Verify that we retrieved at least some metrics
2222
if len(metricsSlice) == 0 {
23-
t.Log("No disk metrics found. Skipping validation.")
24-
return
23+
t.Skip("No disk metrics found. This may indicate restricted disk access or a collection failure.")
2524
}
2625

2726
foundValidDisk := false
@@ -41,14 +40,14 @@ func TestDiskMetricsContent(t *testing.T) {
4140
if diskData.Mountpoint == "" {
4241
t.Errorf("Disk device %s has an empty Mountpoint field", diskData.Device)
4342
} else if diskData.Mountpoint == "unknown" {
44-
+ t.Logf("Disk device %s has default 'unknown' mountpoint (metric collection may have failed)", diskData.Device)
43+
t.Logf("Disk device %s has default 'unknown' mountpoint (metric collection may have failed)", diskData.Device)
4544
} else {
4645
foundValidDisk = true
4746
}
4847
}
4948

5049
// If we iterated through metrics but didn't find any valid disk with a mountpoint, log a warning.
5150
if !foundValidDisk {
52-
t.Log("WARNING: No valid disks with mountpoints were verified")
51+
t.Error("No valid disks with mountpoints were found. The mountpoint feature may not be working correctly.")
5352
}
5453
}

0 commit comments

Comments
 (0)