shirou / gopsutil

psutil for golang
Other
10.28k stars 1.56k forks source link

TestDisk_partitions fails when there are no physical drives mounted #1654

Open gibmat opened 1 month ago

gibmat commented 1 month ago

Describe the bug TestDisk_partitions fails when there are no physical drives mounted:

=== RUN   TestDisk_partitions
    disk_test.go:38: error <nil>
    disk_test.go:40: []
    disk_test.go:43: ret is empty
--- FAIL: TestDisk_partitions (0.00s)

To Reproduce Per the Debian bug report, this occurs with the sbuild unshare backend.

Expected behavior The test detects there are no disks and is skipped.

Environment (please complete the following information): Debian sid

Additional context Originally reported as Debian bug #1071190, forwarding upstream.

shirou commented 1 month ago

Thank you for the report. I believe this test is necessary to detect the issue where drives are no longer recognized. The environment where physical drives do not exist is quite rare, so I don't think we can remove this test to accommodate that scenario.